Draft on Rails. Bootstrap is connected. I do separately Header for the site. But how to use the css file only for Header?
In the folder /app/views/layout created _header.html.erb where the menu structure itself.
In the folder /app/assets/stylesheets file header.scss
In /config/initializers/assets.rb added Rails.application.config.assets.precompile += %w( header.css )
In application.html.erb added <%= stylesheet_link_tag 'header' %> .
Rendered in application.html.erb :
<body> <%= render 'layouts/header' %> <div class="container"> <%= yield %> </div> <%= render 'layouts/footer' %> The CSS file works, but works for the entire site, not for Header. How to make layouts/header render with header.scss file?