I have seen this asked before on here but couldn’t use the suggested solution to fix my issue.
Basically I have implemented the rails pjax gem for a site I am working on, however it only works on some of the content. The home page, and initial level of links down do not load in a pjax-y way, however every subsequent page does.
This is the only place the yield is declared for the site.
<!DOCTYPE html>
<html>
<head>
<title>MyWellbeing.org - What's on your mind?</title>
<%= stylesheet_link_tag "application" %>
<%= raw "<link href='http://#{request.env["HTTP_HOST"]}/sites/site_styles.css' media='screen' rel='stylesheet' type='text/css' />" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
</head>
<body>
<div class="container">
<div id="clicked_off_div" class="display_none"></div>
<%= render 'articles/shared_article_header' %>
<%= render 'articles/logged_in' if user_signed_in? %>
<div data-pjax-container>
<%= yield %>
</div>
<%= render 'articles/shared_footer' %>
</div>
<%= render 'shared/google_analytics' %>
</body>
</html>
Here is the link to the working site http://core.giffordteam.com EDIT: PUSHED TO LIVE SITE
Any pointers on this matter would be greatly appreciated. It is very confusing how some, but not all, pages are working.
Thank you
I managed to fix this issue by removing a div’s onclick functionality and putting it within a separate anchor tag. I then removed the default timeout for the pjax call with
These combined fixed the issue.
Throughout I used Firebug in Firefox with Persist in the Console turned on. This gave a better indication of consistent fails on certain pages, and also when pages didn’t fail what the data should look like.
Massive thank you to Sean Hogan on helping me with this issue. Especially the use of Firebug for debugging.