I have a website and before i included the design and some changes(layout, scripts, etc), it was working fine. Then, I don't know what happened but the onChange method from my select field is accessing "show" action instead of the one that's written in the line.
I have the following at my New view:
<%= collection_select('category', 'id', @categories, 'id', 'name', {:prompt => "Choose a category"}, {:onchange => "#{remote_function(:url => {:controller => 'announcements', :action => "update_subcategories"}, :with => "'parent_id='+value")}",:class => 'newAd_box2_inputField'}) %>
The idea is that it updates a second select field with records related to the selected one.
The second select looks like this:
<%= render :partial => 'category_select', :object => @subcategories %>
Again, it was working great before I introduced some changes, but now it just won't go to "update_subcategories" action, it just goes to "show".
In my routes.rb I've got the following:
map.show "/announcements/:permalink", :controller => 'announcements', :action => 'show'
map.new "/announcements/new", :controller => 'announcements', :action => 'new'
Does anybody know what's going on?