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) App / assets / javascript / applications.js App / Assets / Stylesheet / Bootstrap Configuration CSS. config / application.rb environment / development.rb 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 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.
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 '
// require jquery // requirement Jquery_ujs // = require_tree
* require_tree * = Require_self * / @import "bootstrap";
module Appname class application & lt; Rail :: Application config.assets.enabled = true
... config.assets .debug = true config.assets.raise_runtime_errors = true
& lt;% = stylesheet_link_tag "application"%>
Comments
Post a Comment