On 23 November 2010 15:38, Blake Miller <lists@ruby-forum.com> wrote:
> I have a checkbox tag as follows:
> <%= f.check_box :receive_offers %>
>
> When I view source in the html, I see the value of the checkbox is "1",
> with the normal hidden field value of "0". However, after posting the
> form and saving to the database, the Mysql column, which is a TinyInt,
> is ALWAYS 0.
First have a look in development.log where you will see the parameter
values posted and check that is what you expect. Then if necessary
you can break into your controller code using ruby-debug and can
inspect the data to work out what is happening. See the Rails Guide
on debugging if you are not familiar with this.
Colin
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No comments:
Post a Comment