I want to make an in-place search in my rails app.
I used button_to_remote with prototype, but now I\'m using JQuery, so I changed to link_to.
This is my code:
You can try this:
<%= text_field_tag :address %>
<%= submit_tag "Search", :id => "search_button" %>
### Paste following code in your javascript
$("#search_button").live("click", function(){
$.ajax({
complete:function(request){},
data:'address='+ $('#address').val(),
dataType:'script',
type:'get',
url: '[ROUTE TO ACTION]' // in your case, may be '/[CONTROLLER NAME]/geocode' until you define route
})
});