last day (15 days later) » 

11:42 PM
1
A: Rails: What makes every css file linked to all .erb files

Jeremy RodiIf you mean "views" when you say "erb files," then you'll probably want to take a look at app/views/layouts/application.html.erb. On line 5, you have this: <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> This is what includes the stylesheets on every pa...

 
How do I add a require directive? Would it be require "./stylesheets/admin.css"?
 
No, and for the context of the question, you wouldn't want to require the admin.css file; however, for reference, you'd add = require admin as a comment. Sprockets requires relative to the stylesheets folder, and doesn't require the extension.
 
Are you sure I have to remove <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>? Because when I do that the css doesn't work but when I keep it and only require the css files I need in application.css it works.
 
No, you don't. You have to remove line 13 of your app/assets/stylesheets/application.css.scss, because that requires all of the files in the stylesheets directory.
 
Yep. Thats done. Thank you very much for your help. I am new to rails so I am not sure how everything links together yet.
 
11:42 PM
No problem; if you like, you can add me on Skype and I'd be happy to answer any of your questions.
 

  last day (15 days later) »