在Rails 2.3.5应用程序中,我有:
observe_field:searchtype,:url => {:action =>'set_search_type'},:with => “'search_type ='+ value”
这在Rails3中不再有效。实现这个的新方法是什么?
谢谢,
乔
答案 0 :(得分:3)
JQuery模拟解决方案:
$(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
});
});
});