Skip to content

Instantly share code, notes, and snippets.

@mjtko
Created September 30, 2011 10:27
Show Gist options
  • Save mjtko/1253385 to your computer and use it in GitHub Desktop.
Save mjtko/1253385 to your computer and use it in GitHub Desktop.
Asset pipeline customization
= stylesheet_link_tag 'application', :media => 'all'
= stylesheet_link_tag 'app/print', :media => 'print'
-# implement the however you want obviously, just here as an eg.
- unless @theme.nil?
= stylesheet_link_tag "theme/#{@theme}"
- if controller_specific_styles?
= stylesheet_link_tag "app/#{params[:controller]}"
# config/environments/production.rb
App::Application.configure do
# normal stuff...
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
# mjtko - override the default precompile array first, as it picks up
# more than it should do; see https://github.com/rails/rails/pull/2876
config.assets.precompile = [
/\.(?!css|js)\w+$/,
/application.(css|js)$/
]
# also compile everything in app/ and theme/
config.assets.precompile += [ /^app\//, /^theme\// ]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment