I have a parent model that accepts child specifications.
class user & lt; ActiveRecord :: accepts for base __ nested_attributes_for: spec attr_accessible: name ,: spec_attributes In the view I have a form that can get information for 3 models. I use a normal form_tag.
& lt;% form_tag (verb)% & gt; . . . Do "user [spec_attributes]" for & lt;% fields_. Spec_form |%> & Lt;% = spec_form.check_box: Alert-Greeting% & gt; & Lt;% = spec_form.label: alert_greeting, "Email me when new greeting is posted"%> & Lt;% end% & gt; & Lt;% end% & gt; If the @ user.update_attributes (params [: User]) do in Administrator
@user = User.find (session [: user_id]) something. Database is getting updated and all are working.
However, even when I go back to editing the form again, its value check box showing 1 check box is not checked.
How are any ideas shown when the checkbox is checked?
Thank you very early
Record specific spec Try to change what needs to be referenced in the user who are re-calling & lt;% fields_for "user [spec_attributes]" do | Spec_form |%> to
& lt;% fields_for user.spec. Spec_form |%> You will need to make sure that you have a non-void imagery (but not necessarily saved) created for the user to edit the controller action.
Comments
Post a Comment