This project is archived and is in readonly mode.
[PATCH] select helpers with boolean attributes
Reported by John Allison | January 5th, 2011 @ 07:39 PM | in 3.1
While upgrading to rails 3.0.3, I ran into the following problem:
# blog.rb
class Blog < ActiveRecord::Base
# allow_comments :boolean(1) default(FALSE)
# ...
end
# view inside a form_for(@blog)
<%= f.select :allow_comments, [["On", true], ["Off", false]] %>
If allow_comments was true, "On" would be selected. If allow_comments was false, "Off" would NOT be selected. I've fixed this in the attached patch.
Comments and changes to this ticket
-
John Allison January 5th, 2011 @ 07:44 PM
Sorry, it's not allowing me up upload the patch file.
I've initiated a pull request on github: https://github.com/rails/rails/pull/153
-
Jeremy Kemper January 9th, 2011 @ 11:51 PM
- Milestone set to 3.1
- State changed from new to committed
- Importance changed from to Low
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>