Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Checkboxes seem to require state be manually set #643

agraves opened this Issue · 4 comments

3 participants


Apologies if this is my mistake somehow. I have a boolean field in my model called "top."

Merely rendering:

= form.input :top

Correctly generates a checkbox, but its state (checked vs unchecked) does not seem to reflect the object I'm editing / creating. In order to do this, I had to do the following:

= form.input :top, :as => :boolean, :input_html => { :checked => ( ? 'checked' : nil) }

This behaves as expected (i.e. if is true, the box is checked). It seems kludgy to have to specify this. Am I missing something?

Thank you for your time.

I am using Formtastic 1.2.4, Rails 3.0.8 and Ruby 1.9.2.


I don't remember which version we found an issue on that.

Could you check with formtastic 2.0.0.rc3?


Formtastic 2.0.0.rc3 indeed resolves the issue for me. I was doing some custom wizardry to allow a date-picker field type, which does not work "out of the box" with 2.0.0.rc3, so I'll have to tackle that before upgrading.

Thank you for the quick response and resolution (and for working on such a useful library)!

@agraves agraves closed this

@agraves if I work up a patch for 1.2.4, would you be willing to test it for a 1.2.5 patch release? Not going to bother if there's no one willing to verify it, but happy otherwise :)


Hey Justin,

I'd be happy to verify the issue for you. Just let me know when you have something ready and I'll test it right away.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.