Skip to content

Instantly share code, notes, and snippets.

@heijmerikx
Forked from jpzwarte/gist:286104
Created January 25, 2010 18:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heijmerikx/286107 to your computer and use it in GitHub Desktop.
Save heijmerikx/286107 to your computer and use it in GitHub Desktop.
<% form_tag :search, :url => asdf, :html => { :id => 'search_form' } do %>
<%= text_field_tag :search %>
<%= submit_tag 'zoeken' %>
<% end %>
<div id="search_results"></div>
$('#search_form').live('submit', function(event) {
event.preventDefault();
$.post($(this).attr('action'), $(this).serialize(), null, 'script');
});
def search
@results = ....
render :update do |page|
page.alert 'hohoho'
page.replace_html 'search_results', :partial => 'results'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment