Created
September 30, 2011 10:27
-
-
Save mjtko/1253385 to your computer and use it in GitHub Desktop.
Asset pipeline customization
This file contains hidden or 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
= 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]}" |
This file contains hidden or 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/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