Comments on: Dynamic Select Boxes – Ruby on Rails http://pullmonkey.com/2008/03/30/dynamic-select-boxes-ruby-on-rails/ Sat, 11 Aug 2012 01:21:59 +0000 hourly 1 https://wordpress.org/?v=5.6 By: charlie http://pullmonkey.com/2008/03/30/dynamic-select-boxes-ruby-on-rails/comment-page-3/#comment-19014 Sat, 11 Aug 2012 01:21:59 +0000 /2008/03/31/dynamic-select-boxes-ruby-on-rails#comment-19014 In reply to Bob Hazlewood.

The updated version is now available, go check it out.

]]>
By: Bob Hazlewood http://pullmonkey.com/2008/03/30/dynamic-select-boxes-ruby-on-rails/comment-page-3/#comment-19012 Thu, 09 Aug 2012 03:05:12 +0000 /2008/03/31/dynamic-select-boxes-ruby-on-rails#comment-19012 An updated version of this tutorial would be GREATLY appreciated. With so many of the “examples” I see on the web, I can’t tell what’s “actual” code and what is someone’s pseudo-code.

]]>
By: Akerele Foluso http://pullmonkey.com/2008/03/30/dynamic-select-boxes-ruby-on-rails/comment-page-3/#comment-19010 Mon, 06 Aug 2012 18:19:04 +0000 /2008/03/31/dynamic-select-boxes-ruby-on-rails#comment-19010 Thank you for your reply Charlie, could you kindly elaborate in clear terms on what changes to make and in which files to do I need to make these changes using your code as guide because I am a rails learner and thus cannot figure out your explanation in the previous post. I will really appreciate if you could start from the controller action or better still provide us a new tutorial as you opined that clearly explains this concept.

This has been giving me real though time for more than a week now and I will really appreciate your help in this regard and I am pretty sure it will be helpful to lots of people out there too.

Thanks.

]]>
By: charlie http://pullmonkey.com/2008/03/30/dynamic-select-boxes-ruby-on-rails/comment-page-2/#comment-19008 Sat, 04 Aug 2012 15:22:43 +0000 /2008/03/31/dynamic-select-boxes-ruby-on-rails#comment-19008 Foluso – “remote_function” was the old way, this tutorial is over 4 years old 🙂

Everything has moved away from prototype and to unobtrusive JS with jquery.

So now you would do something like $(‘#artist_id’).change(function() { do your jquery ajax call here });
Also, you’ll need to change the render :update bits. Just create a actionname.js.erb file in your views path for the controller. Then move the code from within the render :update block to the js.erb file, making whatever necessary changes.

I’ll see about doing a 2012 version of this tutorial.

]]>
By: Foluso http://pullmonkey.com/2008/03/30/dynamic-select-boxes-ruby-on-rails/comment-page-2/#comment-19002 Mon, 30 Jul 2012 15:17:33 +0000 /2008/03/31/dynamic-select-boxes-ruby-on-rails#comment-19002 Thanks for this tutorial.
I am working on rails 3.2 and I got this error when I navigated to http://localhost:3000/dynamic (dynamic is the name given to the controller)

undefined method `remote_function’ for #<#:0xa033f68>

What should I do?

]]>
By: ramya http://pullmonkey.com/2008/03/30/dynamic-select-boxes-ruby-on-rails/comment-page-2/#comment-18610 Tue, 18 Oct 2011 17:09:30 +0000 /2008/03/31/dynamic-select-boxes-ruby-on-rails#comment-18610 Thanks a lot Charlie. I have made all the necessary jquery modifications.
I am getting error due to this line.

page.replace_html ‘artists’, :partial => ‘artists’, :object => artists
page.replace_html ‘songs’, :partial => ‘songs’, :object => songs

“Element doesn’t support this property or method” error is seen which is displayed as a pop up on changing the value of the drop down list box.

]]>
By: charlie http://pullmonkey.com/2008/03/30/dynamic-select-boxes-ruby-on-rails/comment-page-2/#comment-18609 Tue, 18 Oct 2011 16:53:42 +0000 /2008/03/31/dynamic-select-boxes-ruby-on-rails#comment-18609 In reply to ramya.

This article was also written at a time when prototype was included. You’ll need to make jQuery modifications.

]]>
By: charlie http://pullmonkey.com/2008/03/30/dynamic-select-boxes-ruby-on-rails/comment-page-2/#comment-18608 Tue, 18 Oct 2011 16:51:41 +0000 /2008/03/31/dynamic-select-boxes-ruby-on-rails#comment-18608 In reply to ramya.

Yes, you do need to specify the routes now. At the time of writing, there was a catch-all mapping for any :controller/:action that was not previously handled.

]]>
By: ramya http://pullmonkey.com/2008/03/30/dynamic-select-boxes-ruby-on-rails/comment-page-2/#comment-18607 Tue, 18 Oct 2011 13:34:31 +0000 /2008/03/31/dynamic-select-boxes-ruby-on-rails#comment-18607 Hi,

I added the route through routes.erb. Now I am getting the error “Ajax undefined”. I am not able to the code hitting the update_releases in my controller.
I have projects which contains releases which in turn contains cycles.

]]>
By: ramya http://pullmonkey.com/2008/03/30/dynamic-select-boxes-ruby-on-rails/comment-page-2/#comment-18606 Tue, 18 Oct 2011 11:50:42 +0000 /2008/03/31/dynamic-select-boxes-ruby-on-rails#comment-18606 Hi,

Please let me know if routes are to be created for update_artists and update_songs.I am getting No route matches error.

]]>