Created
May 14, 2012 15:15
-
-
Save flomotlik/2694525 to your computer and use it in GitHub Desktop.
Asset Pipeline Setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body id="<%= "%s_%s" % [controller_name, action_name] %>"> | |
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.assets.debug = true | |
config.assets.compress = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
group :assets do | |
gem 'sass-rails' | |
gem 'coffee-rails' | |
gem 'uglifier' | |
gem 'yui-compressor' | |
gem 'compass-rails' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#home_index{ | |
.whatever{ | |
margin-top:50px; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?