asset-pipeline

Why Heroku don't use the good manifest.yml

ε祈祈猫儿з 提交于 2019-12-06 13:43:19
问题 I use Rails 3.2.2 on Heroku with CDN (CloudFront) to host assets. I try the Heroku tutorial (https://devcenter.heroku.com/articles/cdn-asset-host-rails31) with asset_sync gem. There is no problem with the assets:precompile, all my assets are hosted on my S3 bucket. -->heroku run bundle exec rake assets:precompile Running bundle exec rake assets:precompile attached to terminal... up, run.1 AssetSync: using default configuration from built-in initializer AssetSync: Syncing. Using: Manifest /app

Rails 3.1 Use an image without fingerprint hash

心不动则不痛 提交于 2019-12-06 12:30:34
I have solved a few of my asset pipeline woes, but one of them remains. I have a couple of image_tags, and I want them to refer to the non-fingerprinted/hashed/digested version. Is there a way to force an image_tag (but only one or two, not application-wide) to use the non-digested version of the image? Take a look at fingerprintless , that should do it. Use :digest => false as an option to asset_path within image_tag <%= image_tag(asset_path("filename.png", :digest => false)) %> 来源: https://stackoverflow.com/questions/9299724/rails-3-1-use-an-image-without-fingerprint-hash

Asset Pipeline: Trouble on deploying my Rails 3.1 application with Capistrano

萝らか妹 提交于 2019-12-06 11:48:34
问题 I am using Ruby on Rails 3.1.0 and Capistrano. I have a problem on make the application to work in production mode (the remote machine is running Ubuntu 10.4 - my local machine is a MacOS running Snow Leopard 10.6.7). When I deploy with Capistrano I get this error: uninitialized constant Rake::DSL When I try to access a web page I get this error: ActionView::Template::Error (application.css isn't precompiled) What I should to do in order to make the application to work in production mode on

Rails 4 Asset Pipeline: Compile both with and without fingerprint

女生的网名这么多〃 提交于 2019-12-06 09:19:21
Rails 4 has changed the way assets are fingerprinted (for browser cache busting): Old Strategy: application.css?12345 Rails 3.2: application-12345.css and application.css Rails 4.0: application-12345.css While this makes perfect sense, it's a problem if the stylesheets are used by another service (in our case Zendesk). This external site needs the CSS from the Rails app, but it doesn't know the fingerprint (aka: digest). Is there a way to compile all assets both with and without fingerprint? Or maybe another approach to tackle this? I've written a rake task to get the un-fingerprinted files à

Conditional javascript require in the asset pipeline

☆樱花仙子☆ 提交于 2019-12-06 09:18:56
I'm struggling with the asset pipeline. I'm loading dojo from Google CDN putting this in my template: = javascript_include_tag 'http://ajax.googleapis.com/ajax/libs/dojo/1.6.1/dojo/dojo.xd.js', :'data-dojo-config' => %Q(dojoBlankHtmlUrl:'/blank.html', baseUrl: 'assets/', modulePaths: {custom: 'javascripts/modules'}) I just want a fallback to a local version if running locally or if the CDN is down. I thought of doing this: script typeof(dojo) === "undefined" && document.write(unescape('%3Cscript src="js/libs/dojo-1.6.1.min.js"%3E%3C/script%3E')); But I don't like it as it works out of the

loading order JavaScript files in asset pipeline

我的未来我决定 提交于 2019-12-06 08:19:24
问题 I am using a Rails 4 application. I installed some JavaScript plugin files in "vendor/assets/javascripts", and some in "app/assets/javascripts" where I have some files that are invoking methods from the vendor files. No methods from these are recognized and it seems that "app/assets/javascripts" files are loaded before "vendor/assets/javascripts" files. How can I deal with that? For information my "application.js" calls: //= require jquery //= require jquery_ujs //= require turbolinks //=

missing fingerprints in asset paths

只谈情不闲聊 提交于 2019-12-06 05:07:50
问题 We just deployed a Rails 3.1 app using the new asset pipeline. In Development everything looks fine, but in production all asset-images are missing. When deploying we followed the Ruby on Rails Edge Guide. As an example, a simple code snippet from our app: asset_path "favicon.png", "images" This generates in production: /assets/favicon.png But the fingerprint is missing (and therefore it is a deadlink on production). We already tried it without the "images", with image_tag instead. Nothing is

Rails asset pipeline: Can it be good practice to include asset in public folder instead of asset folder?

╄→尐↘猪︶ㄣ 提交于 2019-12-06 04:34:41
问题 I've been struggling a bit with adding Google Analytics to my Rails 4 app (see this post). I've got it working by adding the JavaScript code, that Google supplies, in a new file in /public/assets/google-analytics.js . In application.html.erb I have included: <%= javascript_include_tag 'google-analytics' if Rails.env.production? %> This works but I thus haven't included the JavaScript file in app/assets/javascripts/ and placed it in the public folder instead. The JavaScript file thus isn't

Compressing assets in Ruby on Rails 3

删除回忆录丶 提交于 2019-12-06 02:29:57
问题 I have following configurations in production.rb # Disable Rails's static asset server (Apache or nginx will already do this) config.serve_static_assets = false # Compress JavaScripts and CSS config.assets.compress = true # Choose the compressors to use config.assets.js_compressor = :uglifier config.assets.css_compressor = :yui # Don't fallback to assets pipeline if a precompiled asset is missed config.assets.compile = true # Generate digests for assets URLs. config.assets.digest = true But

disable assets precompile function in Rails

蓝咒 提交于 2019-12-06 02:01:27
问题 I would like to disable assets precompile function in rails. I am working on app where user can download the code, and I would like to avoid changeing the names of the css and js files in downloaded html file - so as the user can run the index.html and see everything. Here is the app: http://impress-builder.herokuapp.com/ 回答1: Take a look at The Assets Pipeline Guide. The asset pipeline is enabled by default. It can be disabled in config/application.rb by putting this line inside the