sprockets

Where to put Galleria (jQuery image gallery framework) in Rails 3.1 Asset Pipeline?

落花浮王杯 提交于 2019-11-30 03:46:28
I'm a bit confused as to where to put a jQuery framework like Galleria in Rails 3.1 's new Asset Pipeline ? I know it, technically, should go into /vendors/assets/javascripts but , it is my understanding that, the Galleria folder with the jQuery & themes wants to be in root ( /galleria ) of the live site in order to work correctly. Also, while we're at it, where to put the following script so it will appear only on the page(s) with a gallery? <script> $('#gallery').galleria({ width:500, height:500 }); </script> Edit : Surprised there's no response!?! Maybe Galleria isn't that popular? These

Rails 3.1 Sprockets require directives - is there a way to exclude particular files?

青春壹個敷衍的年華 提交于 2019-11-30 01:14:09
If I'm using //=require_tree . in application.css, is there a way to exclude particular files other than resorting to //=require_directory and tree organization? Perhaps something like //= require_tree ., {except: 'something'} This is possible with Sprocket's new stub directive which is available in Sprockets v2.2.0 and up. However, Rails 3.2 will only ever use Sprockets v2.1.3 which does not have this feature. As of now, the current Edge Rails has the stub directive and it will officially be in Rails 4.0 and above. Usage: //= require jquery //= require_tree . //= stub unwanted_js stub

After gem update: test fail with “Asset was not declared to be precompiled in production”

时光怂恿深爱的人放手 提交于 2019-11-29 23:33:37
Since I updated several gems all tests fail with the error: ActionView::Template::Error: Asset was not declared to be precompiled in production. Add Rails.application.config.assets.precompile += %w( favicons/manifest.json.erb ) to config/initializers/assets.rb and restart your server app/views/layouts/_faviconsheader.html.erb:14:in _app_views_layouts__faviconsheader_html_erb__1320 app/views/layouts/application.html.erb:21:in _app_views_layouts_application_html_erb__4340 The error seems to refer to the partial _faviconsheader.html.erb that includes the line: <%= content_tag :link, nil, rel:

Sprockets encoding error on js file: invalid UTF-8 byte sequence

て烟熏妆下的殇ゞ 提交于 2019-11-29 12:27:25
问题 A Sprockets::EncodingError exception is thrown when I include a file with characters that are valid utf-8. The line in question is: * Copyright (c) 2010 - 2011 Johan Säll Larsson If I replace the ä character, the problem goes away, but I don't want to have to remember to edit this vendor file everytime I update it. How can I fix this? 回答1: I found the solution via the comments on this Sprockets issue: I simply saved the file as utf-8, (TextMate has an option to do this when you chose 'Save As

Asset pipeline, compass font-face and eot?iefix call to the font

非 Y 不嫁゛ 提交于 2019-11-29 09:59:30
问题 I am trying to use a Compass font-face mixin, which contains the inclusion of *.eot?iefix My app/assets/fonts contains all the font types needed, including .eot. When I try to run assets:precompile the task fails saying something like: webfont.eot?iefix isn't precompiled Do you know the possible solution for this problem? It runs with no error in case I have config.assets.compile = true, but as I've understood it's better not to use it on production. 回答1: You can do it with pure Scss too:

Disable Sprockets asset caching in development on Rails 4

谁说胖子不能爱 提交于 2019-11-29 09:31:42
问题 Another question "Disable Sprockets asset caching in development" addresses how to disable Sprockets caching in Rails 3.2. How do you do the same thing on Rails 4? I am working on a gem that is deep in the asset pipeline and having to clear tmp/cache/* and restart Rails is getting tiring. 回答1: If you look at the Sprockets source, you can see that if cache_classes is true then app.assets gets set to app.assets.index , and the filesystem is no longer checked. In order to get around this in

Why does stylesheet_link_tag not link to /assets in production?

寵の児 提交于 2019-11-29 07:18:41
问题 I just did the first deploy for a new Rails 3.1 application, but the assets don't seem to work correctly. I'm precompiling everything upon deploy, and it turns up in public/assets like expected. However, the output of for example stylesheet_link_tag "application" in my layout has a href pointing to /stylesheets/application.css . This obviously does not work. The strange thing is that in development mode everything seems to be fine, it links to /assets/application.css like expected. I've

Disable Asset Pipeline/Sprockets Rails 4.1

旧街凉风 提交于 2019-11-29 05:32:05
I cannot seem to find a way to disable the Asset Pipeline in Rails 4.1. I see a lot of information for Rails 3.2. I want to use Grunt/GulpJs and bower to handle all of my assets and I cannot seem to find something for this. Rather I find a decent amount but most of it doesn't apply to me or is broken. There is the half-pipe gem . However half-pipe relies on Rails 4.0 and I'm on Rails 4.1 and I can't find where to force a Gem to install in different version of Rails, if that's even possible. This question expanded into a few more questions than I intended. Basically I just need to know how to

Disable Sprockets asset caching in development

喜你入骨 提交于 2019-11-29 01:25:21
I'm using Rails 3.2.13 and the Rails Asset Pipeline. I want to use the Asset Pipeline so I can use SASS and CoffeeScript and ERB for my assets and have the Pipeline automatically compile them, so I cannot turn off the pipeline in development. I am not precompiling assets in development ever and there is not even a public/assets/ directory. However, when I make changes to an included file, such as to a _partial.html.erb file that is included (rendered) in a layout.html.erb file, without changing the file doing the including itself (in this example layout.html.erb ), Sprockets doesn't detect the

Where to put Galleria (jQuery image gallery framework) in Rails 3.1 Asset Pipeline?

喜你入骨 提交于 2019-11-29 01:21:06
问题 I'm a bit confused as to where to put a jQuery framework like Galleria in Rails 3.1 's new Asset Pipeline ? I know it, technically, should go into /vendors/assets/javascripts but , it is my understanding that, the Galleria folder with the jQuery & themes wants to be in root ( /galleria ) of the live site in order to work correctly. Also, while we're at it, where to put the following script so it will appear only on the page(s) with a gallery? <script> $('#gallery').galleria({ width:500,