method
fields_for_with_nested_attributes
fields_for_with_nested_attributes(association_name, args, block)
private
Hide source
# File actionpack/lib/action_view/helpers/form_helper.rb, line 1001 def fields_for_with_nested_attributes(association_name, args, block) name = "#{object_name}[#{association_name}_attributes]" association = @object.send(association_name) explicit_object = args.first if args.first.respond_to?(:new_record?) if association.is_a?(Array) children = explicit_object ? [explicit_object] : association explicit_child_index = args.last[:child_index] if args.last.is_a?(Hash) children.map do |child| fields_for_nested_model("#{name}[#{explicit_child_index || nested_child_index}]", child, args, block) end.join else fields_for_nested_model(name, explicit_object || association, args, block) end end


