--- !ruby/object:RI::MethodDescription 
aliases: []

block_params: builder.new(object_name, object, self, options, block)
comment: 
- !ruby/struct:SM::Flow::P 
  body: "Creates a scope around a specific model object like form_for, but doesn't create the form tags themselves. This makes fields_for suitable for specifying additional model objects in the same form:"
- !ruby/struct:SM::Flow::H 
  level: 4
  text: Examples
- !ruby/struct:SM::Flow::VERB 
  body: "  &lt;% form_for @person, :url =&gt; { :action =&gt; &quot;update&quot; } do |person_form| %&gt;\n    First name: &lt;%= person_form.text_field :first_name %&gt;\n    Last name : &lt;%= person_form.text_field :last_name %&gt;\n\n    &lt;% fields_for @person.permission do |permission_fields| %&gt;\n      Admin?  : &lt;%= permission_fields.check_box :admin %&gt;\n    &lt;% end %&gt;\n  &lt;% end %&gt;\n"
- !ruby/struct:SM::Flow::P 
  body: "...or if you have an object that needs to be represented as a different parameter, like a Client that acts as a Person:"
- !ruby/struct:SM::Flow::VERB 
  body: "  &lt;% fields_for :person, @client do |permission_fields| %&gt;\n    Admin?: &lt;%= permission_fields.check_box :admin %&gt;\n  &lt;% end %&gt;\n"
- !ruby/struct:SM::Flow::P 
  body: ...or if you don't have an object, just a name of the parameter
- !ruby/struct:SM::Flow::VERB 
  body: "  &lt;% fields_for :person do |permission_fields| %&gt;\n    Admin?: &lt;%= permission_fields.check_box :admin %&gt;\n  &lt;% end %&gt;\n"
- !ruby/struct:SM::Flow::P 
  body: "Note: This also works for the methods in FormOptionHelper and DateHelper that are designed to work with an object as base, like FormOptionHelper#collection_select and DateHelper#datetime_select."
full_name: ActionView::Helpers::FormHelper#fields_for
is_singleton: false
name: fields_for
params: (record_or_name_or_array, *args, &block) {|builder.new(object_name, object, self, options, block)| ...}
visibility: public
