Skip to content

Instantly share code, notes, and snippets.

@johnbeynon
Created July 14, 2011 10:49
Show Gist options
  • Save johnbeynon/1082256 to your computer and use it in GitHub Desktop.
Save johnbeynon/1082256 to your computer and use it in GitHub Desktop.
Override Rails3 CSS stylesheet and image path
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