Reputation: 395
This is a generalized question. I'm not asking one to write any code for me, I just can't quite wrap my head around this.
I know about f.button but from what I can tell that just acts as a submit button and refreshes things. I've also tried button_tag, but I can't get that working properly either.
I have a Rating form that user's use to submit information (duh). I have 3 different categories that a user can rate "Good" "Ok" "Bad". The "Good", "Ok", "Bad" I would like to be buttons that the user can click and then once that form is submitted this rating goes into the database next to the category. Each time a user submits the rating form they will rate all 3 categories as either "Good", "Ok", "Bad".
A rating belongs to a user and a user has_many ratings.
Example When someone submits the rating form I'd want it to look like this:
ID Category 1 Category 2 Category 3 User ID
1 Good Ok Good 1
Does this make sense? Is this possible to do?
Upvotes: 0
Views: 151
Reputation: 434935
jQuery UI offers some wrapping for standard radio buttons that makes them look like a single button split into several parts. See the radio button section of the button demo:
Upvotes: 1