Reputation: 1100
Am using formtastics in Active Admin gem Everything is working find except one thing that am passing it list to be checked/selected on check boxes list but not working.. So kindly help me in this regard. Thanks..
I tried this in Simple form Its working fine over there but not in Formtastic.
<%= f.input :surgery_type_procedures, :label=>false,:as=>:check_boxes,:required=>false,:collection => st.surgery_type_procedures.all.collect!{ |p| [p.to_s, p.id] },:checked=>@surgery_type_procedures %>
<%= f.input :surgery_type_procedures, :label=>false,:as=>:check_boxes,:required=>false,:collection => st.surgery_type_procedures.all.collect!{ |p| [p.to_s, p.id] },:selected=>@surgery_type_procedures %>
Didn't Select Any check_box out which are in "@surgery_type_procedures" so kindly tell me is formtastic support checked or uncheck option??/
Upvotes: 1
Views: 828
Reputation: 1115
Change p.id
to p.id.to_s
and remove checked
/selected
key. It should be works.
Upvotes: 0