Asset Pipeline not serving assets, specifically Bootstrap in Rails 4.1 -


I have a relatively new Rail 4.1 app which is not serving JS / CSS through asset pipeline.

The app is primarily a JSON API (designated subdomain) with some web-based administration tools. I have established a Rail Admin (which is successfully getting its CSS / JS and looks good), but any other web view does not get the property from the pipeline.

My specific goal is to use bootstrap gem to bootstrap all non-rail admin views.

One thing to note - initially I took away the gemstone file, it would be a pure API, then several related gems will be added back. Maybe it has changed some default behavior? I have definitely installed the bundle.

TL; DR: When I visit a visual boycott of rails_admin, I can not find Bootstrap CSS / JS and the pages have been unstable.

The gem of the current situation (Showing only relevant gems, note I do not have turboilines)

  Mani rail ',' 4.1.6 'Mani' PG Mani 'vs' Mani 'rails_admin' gem 'sprockets-rails' ,: Need => 'Sprockets / railtie' gem 'uglifier' gem "bootstrap-sass" gem 'autoprefixer-rail' gem 'sass-rails',' ~ & gt; 4.0.3 '  

App / assets / javascript / applications.js

  // require jquery // requirement Jquery_ujs // = require_tree   

App / Assets / Stylesheet / Bootstrap Configuration CSS.

  * require_tree * = Require_self * / @import "bootstrap";   

config / application.rb

  module Appname class application & lt; Rail :: Application config.assets.enabled = true   

environment / development.rb

  ... config.assets .debug = true config.assets.raise_runtime_errors = true    

question of donuts Answering Stundys, who wrote the correct answer in the above comment:

"Make sure you include that file in the layout with the stylesheet_link_tag."

I changed the file to named application.css.scss, then it was included in the head of my layout file:

application.html. Erb

  & lt;% = stylesheet_link_tag "application"%>   

And now my page is successfully styled with Bootstrap. Can not believe I could not find mentioning the file in the docs. I thought that this happened through auto magic.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -