Skip to content

Instantly share code, notes, and snippets.

@flomotlik
Created May 14, 2012 15:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flomotlik/2694525 to your computer and use it in GitHub Desktop.
Save flomotlik/2694525 to your computer and use it in GitHub Desktop.
Asset Pipeline Setup
<body id="<%= "%s_%s" % [controller_name, action_name] %>">
</body>
config.assets.enabled = true
#Needs to be false on Heroku
config.assets.initialize_on_precompile = false
# Can be set to invalidate the whole cache
config.assets.version = "1.1"
# Serving static assets and setting cache headers
# which will be used by cloudfront as well
config.serve_static_assets = true
config.static_cache_control = "public, max-age=31536000"
= link_to("", new_user_registration_path, :class=> "buttons-btn_signup button", :alt => "Signup")
@import "buttons/*.png";
@include all-buttons-sprites;
project_type = :rails
#To reduce the CSS output
line_comments = false
# Sprites should be put into public/assets so they can be
# accessed via the asset pipeline
generated_images_dir = "public/assets"
# This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
use Rack::Deflater
run MyAPP::Application
config.assets.debug = true
config.assets.compress = false
group :assets do
gem 'sass-rails'
gem 'coffee-rails'
gem 'uglifier'
gem 'yui-compressor'
gem 'compass-rails'
end
#home_index{
.whatever{
margin-top:50px;
}
}
config.serve_static_assets = true
# Compress JavaScripts and CSS
config.assets.compress = true
# Setting compressor currently doesn't work (thx to @carhartl for the tip) https://github.com/rails/sass-rails/issues/104
config.assets.css_compressor = :yui
config.assets.js_compressor = :uglifier
# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = false
# Generate digests for assets URLs
config.assets.digest = true
# User cloudfront as deployment asset host
# SET THIS AT THE END OF THIS GUIDE,
config.action_controller.asset_host = ENV['ASSET_HOST']
@cheeyeo
Copy link

cheeyeo commented Jun 26, 2013

Hi

thanks for the write up on the blog article and this gist - i had to use a similar config on heroku recently

with regards to adding use Rack::Deflater inside config.ru it caused the entire app to show encoding characters only?

is there any other config i should take note of?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment