Skip to content

Instantly share code, notes, and snippets.

@btucker
Created November 10, 2011 21:48
Show Gist options
  • Save btucker/1356347 to your computer and use it in GitHub Desktop.
Save btucker/1356347 to your computer and use it in GitHub Desktop.
rails 2.3.x-esque remote_form_for in rails 3
<%= form_tag action_path, :id => 'remote_form', :remote => true do %>
<%= submit_tag %>
<% end %>
<div id="result"></div>
<%= javascript_tag do %>
jQuery(function($) {
$("#remote_form").bind("ajax:success", function(ev, data) {
$("#result").html(data);
});
});
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment