aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorVasiliy Ermolovich <younash@gmail.com>2012-02-23 22:04:09 +0300
committerVasiliy Ermolovich <younash@gmail.com>2012-02-23 22:04:09 +0300
commitf0a5d325375d9f453d4cc6c6bf555561e52d4ea7 (patch)
tree72bee6513d826ad5dc8997fce2dd1792bb85fbe7 /actionpack/lib
parentaf988ef5b07cc18bc706e741c6a99652faaf00b4 (diff)
downloadrails-f0a5d325375d9f453d4cc6c6bf555561e52d4ea7.tar.gz
rails-f0a5d325375d9f453d4cc6c6bf555561e52d4ea7.tar.bz2
rails-f0a5d325375d9f453d4cc6c6bf555561e52d4ea7.zip
correct fetching :name option in form fields
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_view/helpers/tags/base.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/helpers/tags/base.rb b/actionpack/lib/action_view/helpers/tags/base.rb
index 1ece0ad2fc..d949ff5194 100644
--- a/actionpack/lib/action_view/helpers/tags/base.rb
+++ b/actionpack/lib/action_view/helpers/tags/base.rb
@@ -75,14 +75,14 @@ module ActionView
def add_default_name_and_id(options)
if options.has_key?("index")
- options["name"] ||= tag_name_with_index(options["index"])
+ options["name"] ||= options.fetch("name"){ tag_name_with_index(options["index"]) }
options["id"] = options.fetch("id"){ tag_id_with_index(options["index"]) }
options.delete("index")
elsif defined?(@auto_index)
- options["name"] ||= tag_name_with_index(@auto_index)
+ options["name"] ||= options.fetch("name"){ tag_name_with_index(@auto_index) }
options["id"] = options.fetch("id"){ tag_id_with_index(@auto_index) }
else
- options["name"] ||= options['multiple'] ? tag_name_multiple : tag_name
+ options["name"] ||= options.fetch("name"){ options['multiple'] ? tag_name_multiple : tag_name }
options["id"] = options.fetch("id"){ tag_id }
end
options["id"] = [options.delete('namespace'), options["id"]].compact.join("_").presence