In my application, I have many controllers and tons of css which could potentially be conflicting if plopped all together. Because of this I am linking my stylesheets on a controller-to-controller basis. The Ruby on Rails Guides suggests the following:
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= stylesheet_link_tag params[:controller] %>
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
* You're free to add application-wide styles to this file and they'll appear at the top of the
* compiled file, but it's generally better to create a new file per style scope.
Rails.application.config.assets.precompile += ......
If you are not using Turbolinks, remove it from your project. It includes:
And consider using
rails new --skip-turbolinks for your next project.