On Mon, 3 Jul 2006, nali wrote:
this work perfect:
<%= check_box “page”, “sent”, :checked => @page.sent %>
thanks for your help!
(sent is tinyint boolean)
I believe the :checked spec is ignored. If you just do:
<%= check_box “page”, “sent” %>
then checked status is already automatically determined by calling
@page.sent, which is expected to return 0 (unchecked) or a non-zero
integer (checked). If you change the above to :checked => 0, you’ll
still find that the box is unchecked unless @page.sent returns 0.
“To fully realize the potential of Rails, it’s crucial that you take
the time to fully understand Ruby–and with “Ruby for Rails” David
has provided just what you need to help you achieve that goal.”
– DAVID HEINEMEIER HANSSON, in the foreword to RUBY FOR RAILS.
Complete foreword & sample chapters at http://www.manning.com/black!