Questions tagged [sprockets]

Sprockets is a Ruby library that preprocesses and concatenates JavaScript and CSS source files.

Sprockets takes any number of source files and preprocesses them line-by-line in order to build a single concatenation.

Specially formatted lines act as directives to the Sprockets preprocessor, telling it to require the contents of another file or library first or to provide a set of asset files (such as images or stylesheets) to the document root.

Sprockets attempts to fulfill required dependencies by searching a set of directories called the load path.

807 questions
0
votes
1 answer

How do I enable the asset pipeline in a Rails project I upgraded to 3.1 from an old version?

I assume this would be the same as enabling the asset pipeline in a project that was created --skip-sprockets - I could be mistaken. I'm trying to run rake assets:precompile to test, and right now, since I've already added require…
mltsy
  • 6,598
  • 3
  • 38
  • 51
0
votes
2 answers

Why are rails javascript assets being precompiled in development?

I have a problem with js files being compiled in development. I have an application.js file that includes multiple other files like this: //=require_tree . the files in the directory are…
Mina Smart
  • 111
  • 6
0
votes
1 answer

Is sprockets caching views/erb files?

I am deploying all my assets on s3, and pre-compiling them on deployment. In theory sprockets shouldn't really do anything during runtime. However, when I debug my cache I keep seeing some sprockets activity: cache miss:…
EugeneMi
  • 3,475
  • 3
  • 38
  • 57
0
votes
1 answer

Dynamic CSS using Sprockets

I'm working on a site builder in rails and I would like to render the sites css using Sprockets SCSS processors. Since the user can change colors and logos, I can't use Sprockets precompilation so I've started working on a Rails SCSS template…
jachenry
  • 137
  • 1
  • 10
0
votes
3 answers

How to load external template synchronously with backbone

I'm trying to build a mobile application with phonegap, backbone.js and coffeescript. I want to do something like this : class MyApplication.Views.EntriesIndex extends Backbone.View template: load('my/template') //It will load the external file…
Dougui
  • 7,142
  • 7
  • 52
  • 87
0
votes
1 answer

Sprockets, SASS and IE's MS-filter (A new blue screen of death)

Hope I managed to bait you in using the BSOD title =) I use a linear-gradient mixin which the syntax is like this: +linear-gradient(top, #ffffff, #f7f7f7) Which generates this in IE after…
Damon Aw
  • 4,722
  • 4
  • 28
  • 37
0
votes
2 answers

How to get the error log from SASS when using the rails asset pipeline?

I've got 3 Rails 3.2 applications using the gem jquery-ui-themes. jquery-ui-themes uses scss for the image-path helper. It works great on two of my applications, but the 3rd doesn't seem to compile the scss files in either development or…
Bryan Larsen
  • 9,468
  • 8
  • 56
  • 46
0
votes
1 answer

Sprockets can't find javascripts in flot-rails gem

I tried to use the foot-rails gem to install flot but was unsuccessful. I added gem "flot-rails" to my gemfile and executed bundle install I then added //= require jquery.flot //= require jquery.flot.resize to my…
levous
  • 902
  • 7
  • 13
0
votes
2 answers

getting bootstrap's css into existing site

I am having problems getting Bootstrap into an existing site. I do the following: in Gemfile (already have: gem 'sass-rails', '~> 3.2.3'): add gem 'bootstrap-sass', '~> 2.1.0.0' at cli: bundle install in application.css add to the top: @import…
timpone
  • 19,235
  • 36
  • 121
  • 211
0
votes
1 answer

How to override sprockets paths in rails?

I'm trying to override the path that Sprockets produces in Rails, particularly for the sass helpers. I've gotten somewhere using various solutions: a) overriding the image_tag helpers in the views b) overriding ActionView::AssetPaths compute…
0
votes
1 answer

Rails - required asset files, @import and global scope variables

I have a bunch of separate files where I hold my variables which are used project-wide. Since variables wont persist through different scss files throughtout the project I have to import them right after the beggining of my application.css.scss…
Ruslan
  • 1,208
  • 3
  • 17
  • 28
0
votes
2 answers

How do I get the digest for a Sprockets generated resource?

When using sprockets, I have a whole directory of .coffee files that transpile, merge together and become 'mobile_v2.js'. When this file gets served up a wonderful ETag is set on it with the SHA1 hash of the content. This allows cache-busting and…
Dave Dopson
  • 41,600
  • 19
  • 95
  • 85
0
votes
1 answer

Better Rails 3 Asset Handling for `cap deploy`

I notice the default "deploy" task does the asset precompilation on the remote machine, which has these ill effects: Weird glitchy assets during the time it's precompiling (on the live site) Errors in the config cause downtime with a 500 response…
rking
  • 1,602
  • 1
  • 10
  • 8
0
votes
2 answers

Capistrano asset precompile error

When I use capistrano to push to my production server I get this error: executing "cd /var/www/my_app/releases/20120731082050 && bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile" servers: ["my_app.com"] [my_app.com]…
0
votes
1 answer

Asset Pipeline Issue Upgrading Rails 3.0 app to Rails 3.2

I've followed the instructions for the Railscast on upgrading a Rails app to 3.1: http://railscasts.com/episodes/282-upgrading-to-rails-3-1?view=asciicast The server doesn't recognize requests for any folders within app/assets. Just to be sure, I've…
Eric Hu
  • 18,048
  • 9
  • 51
  • 67
1 2 3
53
54