ruby on rails - Using turbolinks with dynamic layouts -


i rendering different layouts each controller so:

# layouts/student.html.erb: <% content_for :stylesheets %>   #menu_container {background-color: #3085bd;} <% end %> <% content_for :side_menu %>   <h4 style="text-align: center;"> students</h4> <% end %> <%= render :template => 'layouts/application' %> 

using turbolinks, i've found layout not changing when navigate between different parts of site. page refresh fixes everything.

is there way tell turbolinks grab layout along page content?

i got work placing following lines within body tag of application.html.erb:

<%= content_for?(:side_menu) ? yield(:side_menu) : yield %> <style type="text/css">  <%= content_for?(:stylesheets) ? yield(:stylesheets) : yield %> </style> 

Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -