I’m developing project on rails 2.3.8 and I need to get selected item on dropdown menu in model dialog box. Please can someone explain how to do it on model dialog box on rails ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
An example which will work with some adjustment, as you have given no code (give code and people will be able to give specific answers):
In the view something like this is produced by a form helper:
In JS with jquery something like this to extract name or id of model in select:
No need to involve rails at all unless you want to trigger an action in the controller as well, in which case post from jquery to an action set up specifically for it rather than extracting values:
That is all that observe_field does, and depending on what you want, you may not need it.