Skip to content

Commit

Permalink
adds minus to value part of id [#4862 state:resolved]
Browse files Browse the repository at this point in the history
Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information
RainerBlessing authored and josevalim committed Jun 22, 2010
1 parent dcfb980 commit 70c932f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion actionpack/lib/action_view/helpers/form_helper.rb
Expand Up @@ -1031,7 +1031,7 @@ def radio_button_checked?(value, checked_value)
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?
Expand Down

0 comments on commit 70c932f

Please sign in to comment.