skill-assessment-app/app/views/admin/question/view.html.erb
2016-08-22 16:28:50 -05:00

39 lines
1.0 KiB
Plaintext

<%
content_for :section_title, "Question for #{@question.quiz.name}"
%>
<main class="admin_tpl">
<table cellspacing="0" cellpadding="0">
<tr>
<th>Category</th>
<td><%= @question.category %></td>
</tr>
<tr>
<th>Type</th>
<td><%= @question.input_type %></td>
</tr>
<tr>
<th>Sort</th>
<td><%= @question.sort %></td>
</tr>
<tr>
<th></th>
<td>
<%= check_box_tag 'question_active', nil, @question.active?, {disabled: true} %>
<%= label_tag 'question_active', 'Active' %>
</td>
</tr>
</table>
<strong>Question</strong>
<p><%= @question.question %></p>
<%= fields_for @question do |fields| %>
<%= render partial: "admin/question/#{@question.input_type}", locals: {question: @question, disable: true, fields: fields } %>
<% end %>
<%= link_to('Edit', admin_edit_question_path(@question.to_i), { class: 'btn' }) %>
<%= link_to('View Quiz', admin_quiz_path(@question.quiz_id), { class: 'btn' }) %>
</main>