I'm starting with mongoid and simple_form. If I have a model with :type => Boolean and render it in a (haml) view with =f.input, it creates a text input field not a checkbox.
The doc says that boolean maps to a checkbox but I suspect that Boolean and boolean are not handled the same.
I can work around with adding :as => boolean to the simple_form.
1) Is that expected or am I doing something wrong? 2) Is there a way to add a general mapping of Boolean to simple_form? 3) Should I generate an issue for simple_form to correct this?
Thanks in advance.
Unfortunately, simple_form does not currently work "automatically" with Mongoid. You have to specify the as: :boolean
.
There have been indications that people want Mongoid integration, but I don't think that it has happened yet. So, why not give it a shot? Here are some relevant tickets from the issue tracker:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With