File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
actionpack/lib/action_view/helpers Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -519,16 +519,18 @@ def apply_form_for_options!(object_or_array, options) #:nodoc:
519
519
# Delete: <%= project_fields.check_box :_destroy %>
520
520
# <% end %>
521
521
# <% end %>
522
- def fields_for ( record_or_name_or_array , * args , &block )
522
+ def fields_for ( record , record_object = nil , options = nil , &block )
523
523
raise ArgumentError , "Missing block" unless block_given?
524
- options = args . extract_options!
525
524
526
- case record_or_name_or_array
525
+ options , record_object = record_object , nil if record_object . is_a? ( Hash )
526
+ options ||= { }
527
+
528
+ case record
527
529
when String , Symbol
528
- object_name = record_or_name_or_array
529
- object = args . first
530
+ object = record_object
531
+ object_name = record
530
532
else
531
- object = record_or_name_or_array
533
+ object = record
532
534
object_name = ActiveModel ::Naming . singular ( object )
533
535
end
534
536
You can’t perform that action at this time.
0 commit comments