Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How turn off "replace url" in Pjax

I use Pjax with tutorial from http://railscasts.com/episodes/294-playing-with-pjax?view=comments I don't need change url and this coffee script code doesn't work:

.....

$("a#flag-comments").click ->

....

$.pjax

container: '[data-pjax-container-flag]',

replace: false,

url: '/flag_comments'

....

Any idea?

like image 630
quatermain Avatar asked Mar 27 '12 22:03

quatermain


1 Answers

Set push: false in options. In js, it would be:

$(document).pjax('a', '#pjax-container', {push: false})
like image 150
clime Avatar answered Oct 17 '22 15:10

clime