vendredi 15 janvier 2016

Ruby on rails: How to pass checkbox values to controller

I want to use checkboxes for rating a book.

I want to have 5 integers and for each a checkbox. Only one can be checked. Like: 1 2 3 4 5

and next to each a checkbox.

Those integers don't directly correspond to any value in the database.

How exactly can I do this in my view and how can I use the checked values in my controller? I want to check which one is selected and then update the value of the rating in the database.




Aucun commentaire:

Enregistrer un commentaire