Last Updated: February 25, 2016
·
822
· allankent

Getting Pjax to work

When testing Pjax, be sure to deliver only a code fragment using something like they suggest on the page:

if request.headers['X-PJAX']
    render :layout => false
end  

If you send the full page, it forces a browser refresh, even though the data was requested via the Pjax call.

Seem obvious in retrospect, but might save somebody some head scratching.