khagimoto wrote:
> In my app, I wanted different default value when checked, so I did
> something like this after looking at
> http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#M001612:
>
> <%= form.check_box :country_id, {}, "254, "0" %>
>
> and it has worked for me.
>
> In your case, it would be:
>
> <%= form.check_box :Monday, {}, "1", "0" %>
>
> although the way you have it should work..
Hi, thank you for the suggestion.
I changed it to:
<%= f.label :Monday %><%= f.check_box :Monday, {}, "1", "0" %>
... and I'm still getting a value of 1 in the database, even when I
don't check the checkbox. Can't figure this out, if I remove the
checkbox completely, so it can't be checked, sure enough, the value in
the database becomes 0!
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---