osem-fcy/app/views/admin/questions/_form.html.haml

23 lines
707 B
Text
Raw Normal View History

.row
.col-md-6
2014-02-09 18:05:57 +02:00
%legend Question
2014-07-14 21:13:32 +03:00
= f.input :title, label: 'Your Question'
2014-02-09 18:05:57 +02:00
= f.input :question_type
2014-07-14 21:13:32 +03:00
= f.input :global, label: 'Make Global',
hint: '(Global questions are available for selection to all conferences)'
.col-md-6.hidden{id: 'answers_col'}
2014-07-14 21:13:32 +03:00
= dynamic_association :answers, 'Answers', f,
hint: 'Insert your answers in the order you want them to appear'
:javascript
$("#question_question_type_id").change(function () {
var selected_type = $(this).find('option:selected').text();
if (selected_type == 'Yes/No')
$('#answers_col').addClass('hidden');
else
$('#answers_col').removeClass('hidden');
end
});