In a Rails 2.3.5 app, I have:
observe_field :searchtype, :url => {:action=>'set_search_type'}, :with => "'search_type=' + value"
This no longer works in Rails3. What's the new way to implement this?
Thanks,
Joe
In a Rails 2.3.5 app, I have:
observe_field :searchtype, :url => {:action=>'set_search_type'}, :with => "'search_type=' + value"
This no longer works in Rails3. What's the new way to implement this?
Thanks,
Joe
JQuery analogue solutions:
$(document).ready(function() {
$("#searchtype").bind("blur", function() {
var url = '/set_search_type'; //your real url "??/set_search_type"
var data = {search_type: $(this).val()}; // hash of input names and values for sending to server
$.get(url, data, // make ajax request
function(html) { // function to handle the response
});
});
});