Skip to content

Instantly share code, notes, and snippets.

@jondkinney
Created February 21, 2013 02:03
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 jondkinney/5001343 to your computer and use it in GitHub Desktop.
Save jondkinney/5001343 to your computer and use it in GitHub Desktop.
$('.ajax_save').click (e) ->
e.preventDefault()
$('form').submit() #data-remote is set to true on the form on page load
$('form').attr('action', $('form').data('update-url'))
$('.postback_save').click (e) ->
e.preventDefault()
$('form').removeAttr('data-remote') #on the form on page load
$("form").removeData("remote") #because it's cached
$('form').submit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment