Skip to content

Instantly share code, notes, and snippets.

@kalupa
Created October 26, 2011 18:15
Show Gist options
  • Save kalupa/1317217 to your computer and use it in GitHub Desktop.
Save kalupa/1317217 to your computer and use it in GitHub Desktop.
Upgrade to Rails 3.0 Asset Pipeline - 3.1 defaults
# Enable the asset pipeline
config.assets.enabled = true
# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
# Change the path that assets are served from
# config.assets.prefix = "/assets"
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
Bundler.require *Rails.groups(:assets => %w(development test))
# If you want your assets lazily compiled in production, use this line
# Bundler.require(:default, :assets, Rails.env)
end
# Do not compress assets
config.assets.compress = false
# Expands the lines which load the assets
config.assets.debug = true
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', "~> 3.1.0"
gem 'coffee-rails', "~> 3.1.0"
gem 'uglifier'
end
# 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 = false
# Generate digests for assets URLs.
config.assets.digest = true
# Defaults to Rails.root.join("public/assets")
# config.assets.manifest = YOUR_PATH
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
# config.assets.precompile += %w( search.js )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment