added attachement to admin/question form and view
This commit is contained in:
parent
2f61d58bba
commit
24c61482fe
@ -25,6 +25,15 @@
|
||||
<%= form.text_area :question %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<%= form.label :attachment, "Attachment URL" %>
|
||||
<%= form.text_field :attachment %>
|
||||
|
||||
<% if @question.attachment.present? %>
|
||||
<p><%= image_tag @question.attachment %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<%= form.label :input_type, 'Input Type' %>
|
||||
<%= form.select :input_type, question_type_options(question.input_type), { include_blank: false }, { data: { qid: question.id } } %>
|
||||
|
@ -27,6 +27,10 @@
|
||||
<strong>Question</strong>
|
||||
<p><%= @question.question %></p>
|
||||
|
||||
<% if @question.attachment.present? %>
|
||||
<p><%= image_tag @question.attachment %></p>
|
||||
<% end %>
|
||||
|
||||
<%= fields_for @question do |fields| %>
|
||||
<%= render partial: "admin/question/#{@question.input_type}", locals: {question: @question, disable: true, fields: fields } %>
|
||||
<% end %>
|
||||
|
Loading…
Reference in New Issue
Block a user