mardi 24 juillet 2018

How can i use checked box value in controller?

  • Actually, i`ve never studied HTML or programming language systematically. Now, I'm in a school club that develops web sites and i learned really really basic things. This summer, i am challenging making a small websites with club members.(with significance to the challenge :) ) So please let me know some kind of searching keyword or the simplest code (i only know RUBY) related to below contents. Thank you :)))

This is kind of calculator service. I made this kind of checkbox. I want to apply different formula depending on which one is checked.

def food @post = Post.find params[:post_id]

@result_rice = 1
@result_noodle = 2
@result_meat = 3

How can i set code in my controller? (I am sorry for the low standard of questions :( )




Aucun commentaire:

Enregistrer un commentaire