Using a dynamic number of checkboxes in a rails form
- by TenJack
I am trying to create a form with a dynamic number of checkboxes that each link to a string that is not a model number but is instead just a word. For examples:
<% form_for(@words) do |f| %>
<% ["apple","banana","orange"].each do |word| %>
<%= f.check_box :word %>
<%= f.submit %>
<% end %>
<% end %>
So, if "apple" was checked, it would just send the string "apple" in the params. Anyone know how to do this?