When you call the bootstrap CSS framework, put the bootstrap folder in vendor/assets/
The bootstrap file structure is as follows:
[[email protected] demo]$ ls vendor/assets/bootstrap/
CSS img JS
[[email protected] demo]$ ls vendor/assets/bootstrap/css/
Bootstrap.css bootstrap.min.css bootstrap-responsive.css Bootstrap-responsive.min.css
[[email protected] demo]$ ls vendor/assets/bootstrap/js/
[[email protected] demo]$ ls vendor/assets/bootstrap/img/
Glyphicons-halflings.png Glyphicons-halflings-white.pngbootstrap.js Bootstrap.min.js
In order to successfully pre-compile CSS under the. css file and JS under the. js file, the following actions are required:
1, modify the configuration under CONFIG/ENVIRONMENTS/PRODUCTION.RB, such as:
Add css/*.css js/*.js Precompiled path
Example: Config.assets.precompile + =%W (login.css 960.css query.css user_accounts.css jquery-ui-1.8.20.custom.css css/*.css Js/*.js)
2. Rake Assets:precompile
You will find that the corresponding precompiled files have been successfully generated under PUBLIC/ASSETS/CSS and PUBLIC/ASSETS/JS
Such as:
[[email protected] demo]$ ls public/assets/css/| grep boot*
Bootstrap-78a0f6272d122980f8619d083a59ff47.css
Bootstrap-78a0f6272d122980f8619d083a59ff47.css.gz
Bootstrap.css
Bootstrap.css.gz
Bootstrap.min.css
Bootstrap.min.css.gz
Bootstrap.min-f5df4747a36eb74007d0c4ba70bda825.css
Bootstrap.min-f5df4747a36eb74007d0c4ba70bda825.css.gz
Bootstrap-responsive-60ee06597d41447ace662cae84bcf41f.css
Bootstrap-responsive-60ee06597d41447ace662cae84bcf41f.css.gz
Bootstrap-responsive.css
Bootstrap-responsive.css.gz
Bootstrap-responsive.min-9c6d6ce0e50b323d2e2f199373c69ae0.css
Bootstrap-responsive.min-9c6d6ce0e50b323d2e2f199373c69ae0.css.gz
Bootstrap-responsive.min.css
Bootstrap-responsive.min.css.gz
Rails:css or JS files cannot be precompiled or pre-compiled when calling jquery class plug-ins successfully