mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
adds minus to value part of id [#4862 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
parent
dcfb9805f2
commit
70c932f794
1 changed files with 1 additions and 1 deletions
|
@ -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?
|
||||
|
|
Loading…
Reference in a new issue