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 ?
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-talk/-/OsY_rB0kCg8J.
For more options, visit https://groups.google.com/groups/opt_out.
is any one know this On Tuesday, September 25, 2012 7:37:46 PM UTC+5:30, Fahim Patel wrote:> > 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 ? >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/-_QDOe20YEUJ. For more options, visit https://groups.google.com/groups/opt_out.
On Tue, Sep 25, 2012 at 8:07 AM, Fahim Patel <pafahim-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> is any one know thisStop. This is basic JavaScript/AJAX stuff, and has little to nothing to do with Rails. Find a tutorial on JS/AJAX and learn how it works. Then come back here if you have a specific problem integrating it with your Rails code. -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org http://about.me/hassanschroeder twitter: @hassan -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.