My form is generating a bunch of warnings – WARNING: Can’t mass-assign these protected attributes: id
This is the code I’m using
<% MyModel.all.each do |icon| %>
<%= f.label :attr1, icon.attr1 %>
<%= f.radio_button :attr1, icon.attr2 %>
<% end %>
Note: this isn’t happening on the create or update function where I’ve seen this sort of error before. It is coming from this code here where it generates the radio buttons for the view.
Any ideas?
Thanks
Found the Model was using an overridden All method which was mass assigning the ID field. Fixed that and it fixed the error.