Questions tagged [asset-pipeline]

The asset pipeline provides a framework to concatenate and minify or compress JavaScript and CSS assets. It also adds the ability to write these assets in other languages and pre-processors such as CoffeeScript, Sass and ERB.

The asset pipeline is a feature added to Ruby on Rails 3.1 to provide improved organization and processing for JavaScript, stylesheets, and images. There also exists a Grails plugin named asset-pipeline that provides equivalent functionality to applications developed for this framework.

These assets can be separated into folders under app/assets/ for those that are application-specific, lib/assets/ for assets shared across multiple applications, and vendor/assets/ for third-party assets. Each of those folders would have subfolders like javascripts/, stylesheets/ and images/.

This is meant to eliminate what Ruby on Rails creator David Heinemeier Hansson calls the "junk drawer" approach of putting all JavaScript code (for example) in the same folder, regardless of source.

Additionally, as Ryan Bigg has documented:

The asset pipeline provides a framework to concatenate and minify or compress JavaScript and CSS assets. It also adds the ability to write these assets in other languages such as CoffeeScript, SCSS and ERB. -- Rails Guides

3569 questions
1
vote
1 answer

rails 3.1.0: images with fingerprint not loaded in production

My problem: All images aren't loaded correctly when I start my app in production mode. I see only a placeholder for the image. When I copy the image-url I get "assets/mylogo.png". I miss the fingerprint. My config: Gems: rails 3.1.0 compass, :git…
Sebastian
  • 3,379
  • 2
  • 23
  • 39
1
vote
1 answer

When are compiled assets being cached in rails

When I precompile my assets for a rails 3.1 app with rake assets:precompile it spits out an old cached version if nothing changes in the asset files. I can tell because my erb is making use of a constant that I was trying to change elsewhere in my…
Matthew
  • 12,892
  • 6
  • 42
  • 45
1
vote
2 answers

Rails 3.1 asset pipeline and embeddable javascript widgets: Where should the js live?

I'm upgrading a rails 2.3.9 application and I have a file named widget.js that lives at /public/javascripts/widget.js. Users can embed this javascript widget on their own site like so: