diff --git a/app/views/admin/question/_form.html.erb b/app/views/admin/question/_form.html.erb index 20a6cdf..ea1275a 100644 --- a/app/views/admin/question/_form.html.erb +++ b/app/views/admin/question/_form.html.erb @@ -25,6 +25,15 @@ <%= form.text_area :question %> +
+ <%= form.label :attachment, "Attachment URL" %> + <%= form.text_field :attachment %> + + <% if @question.attachment.present? %> +

<%= image_tag @question.attachment %>

+ <% end %> +
+
<%= form.label :input_type, 'Input Type' %> <%= form.select :input_type, question_type_options(question.input_type), { include_blank: false }, { data: { qid: question.id } } %> diff --git a/app/views/admin/question/view.html.erb b/app/views/admin/question/view.html.erb index c39789c..fc72e6c 100644 --- a/app/views/admin/question/view.html.erb +++ b/app/views/admin/question/view.html.erb @@ -27,6 +27,10 @@ Question

<%= @question.question %>

+<% if @question.attachment.present? %> +

<%= image_tag @question.attachment %>

+<% end %> + <%= fields_for @question do |fields| %> <%= render partial: "admin/question/#{@question.input_type}", locals: {question: @question, disable: true, fields: fields } %> <% end %>