In my project, I have a main stylesheet called application.css
included in the layout file layouts/application.html.erb
:
<%= stylesheet_link_tag "application" %>
However, there is a specific section of the website where I want to use a different stylesheet named dashboard.css
. This stylesheet is defined within the view file index.html.erb
:
<head>
<title>My title</title>
<%= stylesheet_link_tag "dashboard" %>
..
In order to prevent conflicts and keep the dashboard view working correctly, I need to handle the stylesheet linking properly. If I try moving the application layout stylesheet tag to a partial file like _header.html.erb that is rendered with every non-dashboard view, it doesn't solve the issue. What would be the best way to manage these conflicting stylesheets?
<%= stylesheet_link_tag "application" %>
<header>
<div id="headercontainer">
..