To optimize your workflow in Rails 4, it is recommended to rename the file application.css
to application.scss
as using the .scss
extension is more efficient.
However, avoid directly inserting your code into the application.scss
file as this is considered a poor coding practice.
Instead, import your .scss
files (without the extension) as shown below:
*= require_tree .
= require rails_bootstrap_forms
*= require_self
*/
@import "yourfilename";
If you are working with the .sass
extension, make sure to include the following line in your config/application.rb
file:
config.sass.preferred_syntax = :sass
Keep in mind that Rails prioritizes .css or .scss extensions over .sass extensions by default.
In case you accidentally delete the content of your application.scss
, remember to restore it promptly.