I use activeadmin, and it has formtastic built-in, like many of you who know it. I have a model called Project that has a lot in common with ProjectResources.
My custom “editing” and “creating” forms in the active admin for the project looks like this.
form do |f|
f.inputs "Project" do
f.input :name, :input_html => { :readonly => true }
end
f.inputs "Resources" do
f.input :id, :label => "Selected Resources",
:as => :check_boxes,
:multiple => true,
:collection => ProjectResource.all,
:selected => @resources
end
f.buttons
end
My checkboxes display very well, and at the moment I am not getting any errors. The problem, if you might have guessed, is that when rendering the edit page, I would like to show the elements in the checkbox area as “selected” if the project already has ProjectResource as an association.
. activeadmin, formtastic . (2.2.0, 2.1.1, 2.1.0, 2.0.2, 1.2.4)
, activeadmin . - .