R
R
rusrich2018-12-28 11:36:11
Ruby on Rails
rusrich, 2018-12-28 11:36:11

How to bind form values ​​from a dropdown menu to a condition in a method in Ruby on Rails?

Good afternoon.
I want to create a drop-down list in the form that is not related to the database and that, depending on the selected value, the desired method in the model works.
Tell me or direct pliz in which direction to dig.
I can't figure it out myself.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Grudinkin, 2018-12-28
@Hunt666

You need to either make several actions in the controller and make a request to the desired one using javascript, or make private methods in the controller and call them in the desired action, not through case. The first option is more correct.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question