Made it possible to do text_field :account, :name in addition to text_field "account", "name"

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1088 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson
2005-04-04 15:43:17 +00:00
parent d6901bfe93
commit a87c1d4dd8

View File

@@ -149,7 +149,7 @@ module ActionView
DEFAULT_DATE_OPTIONS = { :discard_type => true }.freeze unless const_defined?(:DEFAULT_DATE_OPTIONS)
def initialize(object_name, method_name, template_object, local_binding = nil)
@object_name, @method_name = object_name, method_name
@object_name, @method_name = object_name.to_s, method_name.to_s
@template_object, @local_binding = template_object, local_binding
if @object_name.sub!(/\[\]$/,"")
@auto_index = @template_object.instance_variable_get("@#{Regexp.last_match.pre_match}").id_before_type_cast