views:

244

answers:

3

This page show how to do depended drop-downs using RoR+Prototype. Wonder if somebody would show how to do in JQuery insteaad

http://pullmonkey.com/2008/3/30/dynamic-select-boxes-ruby-on-rails

A: 

You'll need to get rid of all the RJS and recode it in jQuery. It's a bit hard to change this example, but this should get you started:

http://remysharp.com/2007/01/20/auto-populating-select-boxes-using-jquery-ajax/

Ben Alpert
+1  A: 

jRails actually has done most of the work of rewriting the rails javascript helpers in jQuery. You can just install it as a gem..

http://ennerchi.com/projects/jrails

Dan McNevin
A: 

Dan is right. Just use Jrails. That's your easiest bet.

If you would like to code it in jQuery yourself you can learn how to replace rjs templates with your own jQuery code at this good railscast.

allesklar