I have this Rails 4 application with two layouts, which uses Turbolinks and Devise. One layout is displayed when the user is logged out and the other when he's logged in.
In both layouts I use different stylesheets.
The problem is that when I have two browser tabs open and I log out on one of them, the other still has the "logged in" layout and when I click something it redirects to the sign in layout using turbolinks and the stylesheets for the sign in layout doesn't load.
Is there any way to tell turbolinks to reload whole page with stylesheeets from the server side?
Thanks for the answers.
If you upgrade to Turbolinks 3 it seems that in your redirect_to
you can pass turbolinks: false
to force a full refresh. If you want to stay with the older version you can also set config.turbolinks.auto_include = false
in application.rb
and then for the controllers that actually use Turbolinks include Turbolinks::Controller
to enable turbolinks.