11155
(-- --)
May 24, 2011, 8:02am
1
Hello,
How do I disable html5 with simple_form gem?
I tried to type:
SimpleForm.html5 = false
in environment.rb
But this throws error.
undefined method `html5=' for SimpleForm:Module (NoMethodError)
Even though I see...
module SimpleForm
...
mattr_accessor :html5
@@html5 = true
...
end
Any explanation on this? How I can disable it in any other ways?
Thanks.
Kendall1
(Kendall)
May 25, 2011, 7:55pm
3
Since this is a SimpleForm specific question, you ought to consider asking it on its own group:
http://groups.google.com/group/plataformatec-simpleform
If the gem has a bug, you can report it to:
https://github.com/plataformatec/simple_form/issues
That said, according to the main README of the gem:
https://github.com/plataformatec/simple_form (toward the bottom)
…it says you can use: SimpleForm.html5 = false
So, that part is correct. However, you should be putting (you’re on rails 3, yes?) your initialization in an initializer file instead of config/environment.rb. I’d try sticking that line in its own file such as:
$ cat config/initializers/disable_html5.rb
Disable HTML5 for the SimpleForm gem…
SimpleForm.html5 = false