Some time has passed since I developed Rails, and it’s hard for me to get any stylesheet scssto work with my newly created rail.
layouts/application.html.erbhas a default value at the <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>top.
For testing purposes, I created a file main.scssin assets/stylesheets/that looks like this:
* {
border: 1px solid black;
}
I thought the file application.scssshould capture all the stylesheets in the folder and child folders, but that is not the case. (Oddly enough, downloading files is .jsfine.)
I tried RAILS_ENV=production rake assets:precompilebut did nothing. Can someone explain what he is doing?
I tried adding *= require mainand *= require main.scssin application.scss. I even changed the ext file to css for both files. The only way I got CSS rendering is to simply add code to application.scsswhich I don't want to do.
Please help me with this.
EDIT 1
I am going to add more information as I get general answers. I mentioned that this is a new application for rails, so the basic things have already been created in advance. Here's what mine looks like application.scss:
Still nothing works.
source
share