You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Figured out the solution myself, but putting it here for googleability if someone else has the same problem.
We saw the following behavior: if I'm on page /a and click a pjax link to page /b, everything is fine. But when I click a link from there on to page C, the link will say /c?_pjax=true and that's the URL I will see after following it.
The issue is simply that since pjax adds the _pjax=true parameter in its Ajax request for reasons of browser caching, the links in your view may render with that parameter included, depending on how you generate their URLs.
What I did in Ruby on Rails was simply a params[:_pjax] = nil in the controller (a before filter might be appropriate) before rendering the view. Doesn't interfere with the caching but helps the links render without that parameter.
The text was updated successfully, but these errors were encountered:
Figured out the solution myself, but putting it here for googleability if someone else has the same problem.
We saw the following behavior: if I'm on page
/a
and click a pjax link to page/b
, everything is fine. But when I click a link from there on to page C, the link will say/c?_pjax=true
and that's the URL I will see after following it.The issue is simply that since pjax adds the
_pjax=true
parameter in its Ajax request for reasons of browser caching, the links in your view may render with that parameter included, depending on how you generate their URLs.What I did in Ruby on Rails was simply a
params[:_pjax] = nil
in the controller (a before filter might be appropriate) before rendering the view. Doesn't interfere with the caching but helps the links render without that parameter.The text was updated successfully, but these errors were encountered: