Permalink
Browse files

Fixing id generator to match Rails' (removes hyphens and forward slas…

…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 181efb0a535fe0e0dec5e5c308470044af8dcceb
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/formtastic.rb
View
@@ -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

0 comments on commit 181efb0

Please sign in to comment.