asset-pipeline

What are the pros and cons of Asset-Pipeline/Turbolinks from Rails 4 for a big application? [closed]

旧城冷巷雨未停 提交于 2019-12-05 01:11:56
We're working on a pretty big and wide application. The website will have a lot of different sections with some very different user interface requirements and behaviors. Looking into the future, Rails 4 separated the asset pipeline into a separated gem so we can choose to include it or not. The same thing might happen with turbolinks. The question I keep asking myself these days and can't find an answer is: should I use theses libraries in our project or not ? The main issues in my reflection is the fact that the all-in-one file strategy will probably not work and we'll have to use file

Rails 3.1, assets pipeline and IE 6 & 7 in production mode - some CSS & js are not loaded properly

时间秒杀一切 提交于 2019-12-04 23:58:13
问题 Trying out my Rails 3.1 app in production mode ( Debian 6, Ruby 1.9.2, Passenger). I tried it out using IE 6 & IE 7 and some of the assets are not loaded properly. Everything works fine in dev mode. Some css & js are not loaded properly, thou all the files are being compiled. Specifally I'm having issues with the drop-down ( jquery superfish menu). Everything works fine in IE8, IE 9, Firefox, Chrome both in production & development. The problem only shows up in IE 6 & 7 in Production. Tried

Rails 3.1: javascripts not served correctly from vendor/assets directory?

放肆的年华 提交于 2019-12-04 23:38:37
I have organized my javascript files in a couple of directories and I have found the following strange behavior. Given the following tree: + app + assets + javascripts + common + public + common + home - home.js home.js looks like this: //= require jquery //= require jquery_ujs //= require jquery-ui //= require_directory ../../jquery_plugins //= require_directory ../../common //= require_directory ../common //= require_self Now the trick lies in the jquery_plugins directory. I placed this inside vendor/assets/javascripts (which is included in the asset load path, when I check Rails.application

Rails asset pipeline and digest values

送分小仙女□ 提交于 2019-12-04 23:28:30
问题 Does anyone know how exactly the asset digest value is calculated? If I have two JS files which contain various other included JS scripts then will each file maintain the same digest hash if none of the inner scripts have been changed? Or is a new digest value calculated each time the assets:precompile operation is run? 回答1: Grabbed from rails guides When a filename is unique and based on its content, HTTP headers can be set to encourage caches everywhere (whether at CDNs, at ISPs, in

Locomotivecms Assets in Production

无人久伴 提交于 2019-12-04 20:20:14
I have asked this question in the locomotivecms google groups, but haven't gotten any useful response yet. So, trying out here. I have a feeling the issue is not just a rails issue but has something to do with how the locomotivecms engine is implemented. I installed the locomotivecms app as per the instructions here - http://doc.locomotivecms.com/guides/get-started/install-engine The app runs fine in development mode. I then precompiled the assets and started it in production mode ( bundle exec unicorn_rails -E production ). Now when I open the app in the browser, the stylesheets are not

How to avoid precompiling in Rails >= 3.1 asset pipeline when changing application.js

柔情痞子 提交于 2019-12-04 20:01:06
I precompiled my files in the asset pipeline after upgrading to rails 3.1 (and later to 3.2) Now (working in development mode) I have to recompile them after every change to see them appear. As this takes about one minute, development is nearly impossible. I have made the following relevant entries in config/development.rb config.cache_classes = false # Show full error reports and disable caching config.consider_all_requests_local = true config.action_controller.perform_caching = false # Do not compress assets config.assets.compress = false config.assets.compile = true # Expands the lines

Rails4: image_url not generating digest in scss

半城伤御伤魂 提交于 2019-12-04 19:02:33
问题 I can't understand why my css file is not appending digests to my assets with the helper method image_url My assets are correctly precomiled, and files do contain the digest. I also can access them (with the digested url) manually. And most strange thing is that in the beginning it was working. here's my configs: config.assets.js_compressor = :uglifier config.assets.compile = false config.assets.digest = true config.assets.version = '1.0' config.serve_static_assets = false #also tried true

How to have absolute path for stylesheets in mailer with the asset pipeline?

China☆狼群 提交于 2019-12-04 18:53:04
问题 The view helpers in my Mailer template give me relative URLs to the stylesheet and images. Of course, this won't work if I'm viewing the email in Gmail, for example. In apps/views/layouts/mailer.html.erb <%= stylesheet_link_tag "application" %> ... <%= link_to(image_tag("logo.png"), "http://mysite.com") %> Renders as: <link href="/assets/application-c90478153616a4165babd8cc6f4a28de.css" media="screen" rel="stylesheet" type="text/css" /> ... <a href="http://mysite.com"><img alt="Logo" src="

Working with javascript in a view in ruby on rails

橙三吉。 提交于 2019-12-04 18:44:26
Alright guys, I am a ruby noobie here, and I find myself in the unfortunate situation where I am moving a project over from Django to Ruby on Rails. First things first, I am setting up my application.html.erb file, and I cannot seem to get the javascript working. The images and css are coming through, but not the javascript. There are javascript files within the assets directory and within the application.html.erb file. Neither are coming through. All of my images, css, and javascripts are located within their respective directories in app/assets/. My application.html.erb file head tag: <

Rails asset pipeline retina @2x and cache buster timestamps are at odds

空扰寡人 提交于 2019-12-04 18:09:02
问题 retina.js looks for an image with the same filename but with @2x before the file extension The rails asset pipeline adds a cache busting timestamp to the end of the filename This means retina.js is looking for filename-cachebuster@2x.png but the file is at filename@2x-cachebuster.png Anyone have a work around for this? Who's wrong on this ie, should retina.js be trained to look for files at filename@2x-cachebuster.png if the original filename matches a pattern that indicates it has a cache