mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Tighten the rescue clause when dealing with invalid instance variable names in form_helper.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user