I put my nav system in application layout. that way any controller
loading will have the nav system. I have one problem though - the <%=
yield %> is in the body, so how would my controllers specify other css
files?
my application layout would look like this:
title
css include
javascript include
nav system
<%=yield%>
so that means any controllers go into the body immediatly - so can they
not have their own css files without specifying them in application
layout?
I put my nav system in application layout. that way any controller
loading will have the nav system. I have one problem though - the <%=
yield %> is in the body, so how would my controllers specify other css
files?
I put my nav system in application layout. that way any controller
loading will have the nav system. I have one problem though - the <%=
yield %> is in the body, so how would my controllers specify other css
files?
I put my nav system in application layout. that way any controller
loading will have the nav system. I have one problem though - the <%=
yield %> is in the body, so how would my controllers specify other css
files?
You can specify parts of code that will be used in layout, like with
yield / @content_for_layout system.
yield :foo is the same as @content_for_foo, but the first syntax
is now preferred.
my application layout would look like this:
title
css include
javascript include
here put a <%= yield :specific_css %> for example.
nav system
<%=yield%>
And in your view :
<% content_for :specific_css do -%>
<%= stylesheet_link_tag “foo” %>
other code if you want…
<% end -%>