Skip to content

Commit

Permalink
Fixing id generator to match Rails' (removes hyphens and forward slas…
Browse files Browse the repository at this point in the history
…hes)

Signed-off-by: Justin French <justin@indent.com.au>
  • Loading branch information
pat authored and justinfrench committed Jul 1, 2009
1 parent de14a5d commit 181efb0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/formtastic.rb
Expand Up @@ -1128,8 +1128,8 @@ def generate_html_id(method_name, value='input')
else
index = ""
end
sanitized_method_name = method_name.to_s.sub(/\?$/,"")

sanitized_method_name = method_name.to_s.gsub(/[\?\/\-]$/, '')
"#{sanitized_object_name}#{index}_#{sanitized_method_name}_#{value}"
end

Expand Down

0 comments on commit 181efb0

Please sign in to comment.