diff options
author | RainerBlessing <rainer.blessing@googlemail.com> | 2010-06-17 20:12:19 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-06-22 15:10:56 +0200 |
commit | 70c932f794073812818a1bd6b9d7de422b5ef679 (patch) | |
tree | 603cf3be73fbed1b9fcb089a077407ce2c5688eb /actionpack | |
parent | dcfb9805f2013853eb4d6cdd12f0301bb16cbc26 (diff) | |
download | rails-70c932f794073812818a1bd6b9d7de422b5ef679.tar.gz rails-70c932f794073812818a1bd6b9d7de422b5ef679.tar.bz2 rails-70c932f794073812818a1bd6b9d7de422b5ef679.zip |
adds minus to value part of id [#4862 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_view/helpers/form_helper.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb index b0b654d5ce..d44bae9c3e 100644 --- a/actionpack/lib/action_view/helpers/form_helper.rb +++ b/actionpack/lib/action_view/helpers/form_helper.rb @@ -1031,7 +1031,7 @@ module ActionView private def add_default_name_and_id_for_value(tag_value, options) unless tag_value.nil? - pretty_tag_value = tag_value.to_s.gsub(/\s/, "_").gsub(/\W/, "").downcase + pretty_tag_value = tag_value.to_s.gsub(/\s/, "_").gsub(/[^-\w]/, "").downcase specified_id = options["id"] add_default_name_and_id(options) options["id"] += "_#{pretty_tag_value}" if specified_id.blank? && options["id"].present? |