Created
July 14, 2011 10:49
-
-
Save johnbeynon/1082256 to your computer and use it in GitHub Desktop.
Override Rails3 CSS stylesheet and image path
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
module ActionView | |
module Helpers | |
module AssetTagHelper | |
def stylesheet_path(source) | |
compute_public_path(source, "stylesheets/<some sub dir here>", 'css') | |
end | |
alias_method :path_to_stylesheet, :stylesheet_path | |
def image_path(source) | |
if File.exists? File.join(Rails.root, "public/images/<some sub dir here>", source) | |
compute_public_path(source, "images/#{AppConfig.get 'assets_subdir'}") | |
end | |
end | |
alias_method :path_to_image, :image_path | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment