views:

309

answers:

2

I am trying to make an onchange call on a select box.For my application i am using jquery.js and rails.js as mentioned to make use of UJS. But still the code that is generated is for Prototype and not for jquery ajax calls. My code looks like the following:

<%=select_tag :category,options_for_select(Category.find(:all,:select=>"name,id").collect{|c|[c.name,c.id]}),:onchange =>remote_function(:url => {:controller => "posts", :action => "filter_post",:filter =>"category"}, :with=>"'category_id=' + $('#category').val()") %>

The code that is generated by this is: new Ajax.Request('/posts/filter_posts?filter=category', {asynchronous:true, evalScripts:true, parameters:'category_id=' + $('#category').val() + '&authenticity_token=' + encodeURIComponent('CCyYj1wqXtddK6pUV6bAxw0CqZ4lbBxDGQHp13Y/jMY=')})

A: 

I'm having the same problem. Any ideas out there?

Andy
A: 

I'm shouting out to echo the above two people - have the same problem. Any help would be greatly appreciated.