I am new to RoR and I am looking for a way to dynamically display values in some text fields depending on the option chosen from a select menu in a form. The associated records are stored in another table. Hopefully in a way AJAX can be used such that it wouldn’t require a page refresh. I have seen examples in which select menus are dynamically changed according to values of select menus but not text fields.
Thanks,
Alex
PS: I am using rails 3.
I am new to RoR and I am looking for a way to dynamically
Share
Here’s how I did it. I’m a Rails beginner too, so this may not be the best/most efficient way, but it works:
JS:
Controller:
View:
Partial: