So I’ve got some objects that I’m passing as a collection:
@things = Thing.all
And in my view:
<%= f.input :things, :collection => @things, :as => :check_boxes %>
Is there any way to specify which of the objects should already be checked when the view is loaded?
Thanks!
In your controller’s “new” action, you want to initialise the form object with the values you want by default:
This can also be done as an
after_initializehook in the model itself.