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
3 answers

Rails 3.1 assets: Calling image_url in scss raises Unrecognized file type

When I call image_url('path/to/image.png') in my css.scss file, I get this error: ActionView::Template::Error (Unrecognized file type: png) (in /home/ramon/source/unstilted/app/assets/stylesheets/admin.css.scss)): ... …
Ramon Tayag
  • 15,224
  • 9
  • 43
  • 69
1
vote
1 answer

Should I port my existing Jammit asset pipeline to the new Rails 3.1 version?

We've implemented Jammit for asset caching, compression and optimization in our Rails application. It's fully integrated with our continuous integration process and works well. That said, I am seeing 3.1 introduces a new canonical asset pipeline…
Joshua
  • 5,336
  • 1
  • 28
  • 42
1
vote
1 answer

Rails 3.1rc6 rake asset:precompile breaks paperclip default images

I have the following paperclip setup in one of my models: has_attached_file :avatar, :styles => { :large => "#{APP_CONFIG["uploads"]["images"]["size"]["large"]}>", :profile =>…
emrass
  • 6,253
  • 3
  • 35
  • 57
1
vote
1 answer

Why do I get "no route matches" for requests to the asset pipeline?

I'm working on upgrading an app to use Rails 3.1 and I'm trying to use the asset pipeline. As a test, I've added foobar.js to app/assets/javascripts. The Setup In application.rb, I've added config.assets.enabled = true. Going on this guide, I think…
Nathan Long
  • 122,748
  • 97
  • 336
  • 451
1
vote
1 answer

What is "//= require" in a JavaScript file in a Rails app?

I'm looking at the source code of a Ruby on Rails app. Several of the JavaScript (*.js and *.es6) files in the source have one or more lines at the top of the file like: //= require path/to/some_other_js_file What are these lines called, and what…
Jon Schneider
  • 25,758
  • 23
  • 142
  • 170
1
vote
1 answer

Using ES6 module with asset pipeline of ruby on rails

I am converting old functional-based syntax Javascript to ES6 classes . Previously code was like this : var SW; if(SW.app === undefined) SW.app = {}; SW.app.NullLicense = (function () { "use strict"; var NullLicense; NullLicense =…
1
vote
1 answer

Rails 3.1 Asset Pipeline: Precompiled MD5 Fingerprints don't match

I'm having a Rails 3.1 rc6 app on Heroku's cedar stack (ruby 1.9.2). I precompile assets using rake assets:precompile RAILS_ENV=production locally on my development machine. The problem is the generated md5 fingerprints in the precompiled filenames…
Nico
  • 881
  • 1
  • 6
  • 19
1
vote
0 answers

angular 11: image path is given from assets after `Ng build` in s3 is listing directly under `dist` folder and `dist->assets` is wont created

it is s3 location after files deployed,it shows like this buti need it like this for the path cofigured all the assets files are out side of the assets folder and asset folder wont created. the image path is defined by assets folder.
guna
  • 11
  • 2
1
vote
2 answers

Rails recompile assets with data from database

I want to recompile assets with data from database. My app will only have less than 10 users and I want to compile stylesheets in public/assets folder at the time of deployment. In database, I have a table that stores user's color preference. …
Matt-pow
  • 946
  • 4
  • 18
  • 31
1
vote
1 answer

precompiling assets locally gives absolute url for background scss urls

I am using heroku for my rails app. And I precompile assets locally and then deploy. So whenever I run bundle exec rake assets:precompile my URLs in scss are converted from relative paths to absolute paths in precompiled scss so /home.png is…
Saqib Shahzad
  • 982
  • 12
  • 28
1
vote
6 answers

Css changes are not being applied in rails app

I am working on rails app and now I am having trouble. Early when I use to change my frontend styling and apply changes in css then they quickly show up on reload in brower. But in present, don't know but something went wrong. Whenever I change…
1
vote
1 answer

Why does fullcalendar give the error that it does not provide an export called 'default'?

I am trying to use the fullcalenar library through stimulusjs to display the calendar in a rails app, without a webpacker. To start I just want to show the calendar, without complexity, as in the documentation, and the controller I am trying to do…
1
vote
1 answer

undefined method `args=' for [[]]:Sass::Tree::FunctionNode deploying to heroku with rails 3.1

I have an app that I am trying to deploy to Heroku Cedar stack with rails 3.1.0.rc5. Some blogs that I followed implementing the migration to cedar and asset…
1
vote
0 answers

ActionView::Template::Error Upgraded from Rails 4.0 to Rails 4.2.11.3

I have recently upgraded the application from Rails 4.0 to Rails Rails 4.2.11.3 All Assets precompiled successfully and at only place I am getting the ActionView::Template::Error. ActionView::Template::Error (folders.js): 15: =…
1
vote
1 answer

rails 3.1 assets are not available

I started playing around with rails 3.1.rc4 but the first problem I'm having is that the assets are not available. I created a brand new project and in the index page the rails image gives 404. Actually any assets are available. I checked #…
ecoologic
  • 10,202
  • 3
  • 62
  • 66
1 2 3
99
100