<%= check_box :modelname, :attribute, options, on_value, off_value %>
Example:
check_box "post", "validated" # post.validated? returns 1 or 0
<input type="checkbox" id="post_validate" name="post[validated]"
value="1" checked="checked" />
<input name="post[validated]" type="hidden" value="0" />
check_box "puppy", "gooddog", {}, "yes", "no"
<input type="checkbox" id="puppy_gooddog" name="puppy[gooddog]"
value="yes" />
<input name="puppy[gooddog]" type="hidden" value="no" />
Just use it..
If you can't understand, get back again
--
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
-~----------~----~----~----~------~----~------~--~---