Friday, 23 August 2013

Form options as radio buttons or regular buttons?

Form options as radio buttons or regular buttons?

I'm very new to Rails, doing a few tutorials, and I don't have a
background in web development, so apologies in advance.
I'm creating a pretty simple app that allows a user to select one of three
available status updates. Should I store these three status updates as a
string or integer? Currently, my Postgres database stores the statuses as
integers, though I'm also curious if there's a way I can specify that only
the numbers 1, 2, or 3 can be inserted.
Second question: I want to display a form that shows as three buttons,
each button corresponding to a specific, set status update. I want the
button to display with a string inside so that it's human readable, but
with that status update corresponding to either 1, 2, or 3. The user can
choose which status, change which status they've selected if they change
their mind before submitting, and then hit a submit button once they've
made up their mind.
Should I use radio buttons to accomplish this? If so, how should I make it
where the radio button displays text and then saves as the integer? Or
should I just use a normal button?
Many thanks!

No comments:

Post a Comment