Rails Asset Organization

Source: Internet
Author: User
Tags comments http request

The role of Rails Asset Pipeline is to compress a bunch of CSS files into a CSS, compressing a bunch of JS into a JS, reducing the HTTP request when accessing the page. where are the css/js stored? (Lego parts)

In rails, the style file is saved in the following two file directories:

App/assets

Applied style files, such as articles, users, comments Css/js

Lib/assets

External source style files, such as Videojs,jquery plugin manifest files (drawings)

In the assets directory, there is a class of declaration files (manifest), typically application.css or application.js.

The point of their existence is to tell the app: What CSS files I have included.

successful compilation (Lego robot)

In a production environment, rails places the compressed files in the public/assets. Only one JS only one CSS removed spaces, comments, line breaks, etc. create a gzip version of the style file

When the user initiates the request, it can be thrown directly to the user after compressing the file.

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.