I am little confusing that I am using bootstrap in rails project. I want use bootstrap in admin areas and not in home. But It doesn’t work. I have added @import “bootstrap” into stylesheet/admin/admin.css.scss – not working. But If I add this into stylesheet/application.css.scss it’s working, but it’s override all other css styles and alos apply on home page which I don’t want.! Project dir Image.
I have added javascript and css include tag into views/layout/admin.html.erb same as application.html.erb
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
Any another way to include only admin/*.css files into admin.
In your stylesheet folder create an admin.css.scss file with the following content:
Then, in your admin layout you can include just the newly created admin.css.scss stylesheet, like this:
It will act as a loader of all css/scss files in the “admin” subfolder.