Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use record_name to make fields for methods more consistent

  • Loading branch information...
commit 82f33dce9c6229bee35af35a9aa3bc9c144737f3 1 parent f0479cb
@carlosantoniodasilva carlosantoniodasilva authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 actionpack/lib/action_view/helpers/form_helper.rb
View
12 actionpack/lib/action_view/helpers/form_helper.rb
@@ -584,8 +584,8 @@ def apply_form_for_options!(object_or_array, options) #:nodoc:
# <% end %>
# ...
# <% end %>
- def fields_for(record, record_object = nil, options = {}, &block)
- builder = instantiate_builder(record, record_object, options, &block)
+ def fields_for(record_name, record_object = nil, options = {}, &block)
+ builder = instantiate_builder(record_name, record_object, options, &block)
output = capture(builder, &block)
output.concat builder.hidden_field(:id) if output && options[:hidden_field_id] && !builder.emitted_hidden_id?
output
@@ -898,13 +898,13 @@ def range_field(object_name, method, options = {})
private
- def instantiate_builder(record, record_object, options, &block)
- case record
+ def instantiate_builder(record_name, record_object, options, &block)
+ case record_name
when String, Symbol
object = record_object
- object_name = record
+ object_name = record_name
else
- object = record
+ object = record_name
object_name = ActiveModel::Naming.param_key(object)
end
Please sign in to comment.
Something went wrong with that request. Please try again.