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

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
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
This topic is locked and can not be replied to.