I'm trying to have a simple webform in my administration section to
add a user. I have the text_fields for adding the user's name,
password, and password confirmation, but cannot seem to figure out the
checkbox. I want it to be a single checkbox, that if clicked, will set
the database column "access" to be "admin" and if its unchecked, set
it to be "user". This is what I have so far but nothing is rendering
just because of the check_box line.
I’d open up the db and make sure the field is there. Then restart the web server (just in case it didn’t pick up the db change).
The code you have should work… :access should be the method on the object bound to the form (user). If it’s burping at you, it’s probably that the field isn’t there.