Rails:css or JS files cannot be precompiled or pre-compiled when calling jquery class plug-ins successfully

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.