Forum: Ruby on Rails How to get data from database table 'drivers' with the help of this.options[this.selectedIndex] ?

274892a7240efb459570e3e9d122607f?d=identicon&s=25 Ajit Teli (ajitteli)
on 2012-07-30 11:47
Hi all,

   I have a table named 'drivers' in database. And in UI, for select_tag
onchange, when I change the driver from dropdown menu I will get the
changed driver with the help of this.options[this.selectedIndex].

Now how can I fetch the data related to selected driver from database?

For example, there are 5 drivers (d1, d2, d3, d3, and d5). When I change
from d1 to d2, I need to confirm that d2 driver is free now by getting
the data from drivers table.

Thanks,
  AJit
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.