I have an Activity and Type Model.
Activities has_many Types, Types has_many Activities
I would like to have checkboxes for all types when I create an activity so the ones that are checked, are the types of the new activity.
in my controller I did send all the types(@types) and in my view i did this
<div class = "field">
Choose types:
<% for type in @types %>
<%= f.check_box :type %>
<% end %>
</div>
- I get an error
undefined method 'type' - I don't know what to do in the create action to get this to work