Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save itssomething/0adc5109c9d89bc690f2083dfab7c457 to your computer and use it in GitHub Desktop.
Save itssomething/0adc5109c9d89bc690f2083dfab7c457 to your computer and use it in GitHub Desktop.
test temp
<%= @questions.each.with_index(1) do |q, index| %>
<div><strong><%= index %>. &nbsp<%= q.name %></strong></div>
<%#= question.answers.each do |answer| %>
<div><%#= answer.content %></div>
<%# end %>
<%= fields_for q do |ff| %>
<div class="answers-list">
<% if q.is_multi? %>
<%= q.answers.each do |a| %>
<div>
<%= check_box_tag ("question[#{q.id}]").to_sym, a.id %>
<%= label_tag ("question[#{q.id}]").to_sym, a.content %>
</div>
<% end %>
<% else %>
<%= q.answers.each do |a| %>
<div>
<%= radio_button_tag ("question[#{q.id}]").to_sym, a.id %>
<%= label_tag ("question[#{q.id}]").to_sym, a.content %>
</div>
<% end %>>
<% end %>
</div>
<% end %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment