RailsCasts Pro episodes are now free!

Learn more or hide this

John Manuel's Profile

GitHub User: bitencode

Comments by John Manuel

Avatar

Thanks VonD,

I finally had a chance to get back to this and discovered that tonight. After getting it working I came back here to let David know how I solved it. You are correct, the timeout is very low and at least for me running nginx/passenger/rails in dev mode is just too slow to respond. I changed the JS/CoffeeScript to:

ruby
jQuery ->
   $('a').pjax('[data-pjax-container]', {timeout: 2000})

Now it's working find :)

Avatar

I'm seeing that too. In the browser I get a pjax response and the page paints, then immediately I get a full page refresh. Watching the development.log in my app, I see (for example) a GET "/projects/28?_pjax=true" which runs the controller and renders the views. Then immediately there is another request "GET /projects/28" which again runs the controller, renders thew view and sends it back to the browsers. On the second request all the assets (images, javascript, etc...) are sent also.

I haven't found a solution yet.