Tighten the rescue clause when dealing with invalid instance variable names in form_helper.
This commit is contained in:
parent
d79cde37ea
commit
75e04b5295
|
@ -601,7 +601,11 @@ module ActionView
|
|||
end
|
||||
|
||||
def object
|
||||
@object || (@template_object.instance_variable_get("@#{@object_name}") rescue nil)
|
||||
@object || @template_object.instance_variable_get("@#{@object_name}")
|
||||
rescue NameError
|
||||
# As @object_name may contain the nested syntax (item[subobject]) we
|
||||
# need to fallback to nil.
|
||||
nil
|
||||
end
|
||||
|
||||
def value(object)
|
||||
|
|
Loading…
Reference in New Issue