0

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?

4
  • Sounds like you want radio buttons. Commented Oct 18, 2012 at 4:09
  • I guess a good way to say it is I want the functionality of radio buttons but with a "button" look. Is there a way to do that with just css? Commented Oct 18, 2012 at 4:25
  • You mean like this? Commented Oct 18, 2012 at 4:38
  • awesome. That should do the trick. Want to answer it, so I can accept that? Commented Oct 18, 2012 at 4:43

1 Answer 1

1

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:

http://jqueryui.com/button/#radio

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.