Forum: Ruby on Rails How to do this ?

Posted by fahim patel (fahim_patel)
on 2012-09-24 14:02
(Received via mailing list)
I wish to select one value from drop down and second drop down should 
shows
those values which are related to that  selected value
from first drop down.

It should be dynamic ?

Did i have to use Ajax ?
Posted by KUL KING (Guest)
on 2012-09-24 14:05
(Received via mailing list)
It should be done using javascript. Or if you want to get the values of
second dropdown from server then you have to use AJAX.
Posted by Kashif Umair Liaqat (Guest)
on 2012-09-24 14:05
(Received via mailing list)
It should be done using javascript. Or if you want to get the values of
second dropdown from server then you have to use AJAX.
Posted by fahim patel (fahim_patel)
on 2012-09-24 14:11
(Received via mailing list)
can i get tutorial and help ful links ..
I wish use both javascript and Ajax..
Posted by Kashif Umair Liaqat (Guest)
on 2012-09-24 14:13
(Received via mailing list)
I don't have specific tutorials to follow. Google is your best companion
for this purpose. If you can share some of your code then I can help you 
to
take a start.
Posted by fahim patel (fahim_patel)
on 2012-09-25 16:08
(Received via mailing list)
code :

Area
<%= f.select :area_id, Area.all.collect {|p| [ p.name, p.id ] },
:class=>"small"  %>
Milk Mans
<%= f.select :milkman_id, Milkman.all.collect {|p| [ p.name, p.id ] },
:class=>"small"  %>

When i select any area then i should see only those milkmans of that 
area.
Till now i getting all milkmans in my select box.

How to do this with Ajax ?

Hope u will understand  question now ?
Posted by KUL KING (Guest)
on 2012-09-25 16:15
(Received via mailing list)
I understood the question but I don't know that why I am unable to 
answer
this. I think you should provide me the HTML code which is shown in page
source after the page is loaded. It's embarrassing for me that I am 
unable
to understand the code in your html.erb file.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.