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

How can I peek at intermediary files processed by asset pipeline?

I've got somefile.js.coffee.erb file which is processed by Rails asset pipeline. My ERB code returns some string that cannot be parsed by Coffee which result in SyntaxError exception. I would like to peek into generated somefile.js.coffee file, or…
Kangur
  • 7,823
  • 3
  • 30
  • 32
0
votes
1 answer

NoMethodError: undefined method `less_config` for

I just setup twitter-bootstrap-rails as described in it's guide and now I'm getting this error on line 39 in the lib/less/rails/template_handlers.rb of less-rails app/assets/stylesheets/application.css /* * This is a manifest file that'll…
Martin Klepsch
  • 1,875
  • 3
  • 18
  • 24
0
votes
2 answers

Arbitrary Sprockets asset path in assets only gem for Rails/Sprockets

I'm trying to make and distribute a Ruby Gem where I package CoffeeScript files for use in other applications. It works fine in most Sprockets apps, but when I try to include it in a Rails App I get: undefined method `append_path' for…
Daniel X Moore
  • 14,637
  • 17
  • 80
  • 92
0
votes
1 answer

Installing redmine_contacts plugin for bitnami_redmine

I am trying to install redmine_contacts plugin for my redmine 2.2.3.0 (which is installed using BITNami installer), as in readme.rdoc: Copy redmine_contacts plugin to {RAILS_APP}/plugins on your redmine path Run bundle install --without development…
mtoloo
  • 1,795
  • 3
  • 22
  • 28
0
votes
1 answer

Why does Rails duplicate assets when using yield?

I've read and tried the solutions here (Ruby On Rails 3.1 - assets pipeline - assets rendered twice) for the duplicate assets problem in Rails, but it's not working on my scenario, which looks like this: Layout:
fegemo
  • 2,475
  • 6
  • 20
  • 40
0
votes
1 answer

rails sprockets include_tree

so here is my problem sprocket defines these directives include require_directory require_tree require_self depend_on stub so what I miss is an include_tree directive to include all javascript sources (placed in another directory) in one file! what…
Nick Sanders
  • 693
  • 2
  • 9
  • 19
0
votes
1 answer

Rails 3, IE assets

Is there a good practice to organizing stylesheet/javascript asset files specifically for IE browsers with asset pipeline enabled in Rails 3? For example, I do not want to litter my .html.erb files with conditional comments similar to below for…
RubyFanatic
  • 2,241
  • 3
  • 22
  • 35
0
votes
1 answer

Share rails templates front and back with JST support

I would like to share js templates between front and back in a rails application for cases where the code would be duplicated. The requirements are: Either underscore (ejs) or handlebars/mustache templates. Preferably ejs because I'm already using…
zanedev
  • 558
  • 5
  • 16
0
votes
1 answer

Sprockets::FileNotFound - couldn't find file 'query.effects.core'

I'm getting this file not found error when I go to localhost:3000 when I start running my rails server. The message I'm getting is couldn't find file 'jquery.effects.core'. I've pretty much done everything I can from pulling a new clone of the app…
vette982
  • 4,782
  • 8
  • 34
  • 41
0
votes
2 answers

rails environments issue with assets compiled and uncompiled

I'm hoping this is super simple, cause it's very basic. using the assets pipline got a css in sub sub folder, exampla vendor->stylsheets->foo->bar->style.css in this style.css I got the following…
Chen Kinnrot
  • 20,609
  • 17
  • 79
  • 141
0
votes
1 answer

Encapsulate javascript for an embedded widget

I have a javascript file that users can embed on their site. It uses coffeescript and the Rails asset pipeline to compile a bunch of files into one. # The following dependencies will be compiled into test.js (rails asset pipeline manifest…
Brian Armstrong
  • 19,707
  • 17
  • 115
  • 144
0
votes
1 answer

Requiring a file from a required file in Sprockets

I would like to require a javascript file that itself requires other javascript files: In main.js //= require plugins ... Shared Code In plugins.js //= require vendor/handlebars-1.0.rc.1.js //= require vendor/jquery.animate-colors-min.js //=…
Undistraction
  • 42,754
  • 56
  • 195
  • 331
0
votes
2 answers

Is it possible in Rails/Asset pipeline compress several SVGs to one file?

As you know you can compress several CSS files to one (or JS files). I was wondering if it's possible to compress several SVG to one external file, so the server makes just one request Basically SVG files are just XML text so it's theoretically…
equivalent8
  • 13,754
  • 8
  • 81
  • 109
0
votes
1 answer

How can I precompile all css files in a particular folder?

To precompile all css files in a project I could add this to production.rb: config.assets.precompile << '*.css' But how can I add only css files in a particular folder?
Undistraction
  • 42,754
  • 56
  • 195
  • 331
0
votes
1 answer

Non-digest .js linking to cache-digested assets

I'm currently using asset_sync to move my assets to S3 from Rails. We serve our JS library as a bootstrap.js which bootstraps other stylesheets/js that should be cache-controlled via the digest. Since I want to be able to change functionality to…
nambrot
  • 2,551
  • 2
  • 19
  • 31