#127 √ invalid
GMFlash

[PATCH] Better handling of :checked attribute in checkbox_field

Reported by GMFlash | June 9th, 2008 @ 08:15 PM

#checkbox_field didn't have any way to force an unchecked box. This made code like:

checkbox_field(:checked = some_condition ? true : false)

impossible because it would still add a checked="false" attribute to the generated html and the browser would check the box.

This patch will remove the :checked attribute if it is set to false, nil, or "". It will also make :checked => true generate the proper checked="checked" html.

Comments and changes to this ticket

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins