Skip to content

Instantly share code, notes, and snippets.

@olivoil
Created June 17, 2011 18:10
Show Gist options
  • Save olivoil/1031935 to your computer and use it in GitHub Desktop.
Save olivoil/1031935 to your computer and use it in GitHub Desktop.
pjax on forms which use method=GET
# Source: https://github.com/nz/pjax-rails/commit/9306f6196053e1ae8fb546077e2dc009c5ab3c15
$ ->
$('a:not([data-remote]):not([data-behavior])').pjax('[data-pjax-container]')
$('form[method=get]:not([data-remote])').live 'submit', (event) ->
event.preventDefault()
$.pjax
container: '[data-pjax-container]'
url: this.action + '?' + $(this).serialize()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment