Created
July 29, 2012 02:54
-
-
Save douglascamata/3195859 to your computer and use it in GitHub Desktop.
Monkey patch to fix relative url issues with assets in Rails 3.1
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
| module Sass | |
| module Rails | |
| module Helpers | |
| protected | |
| def public_path(asset, kind) | |
| resolver = options[:custom][:resolver] | |
| asset_paths = resolver.context.asset_paths | |
| path = resolver.public_path(asset, kind.pluralize) | |
| if !asset_paths.send(:has_request?) && ENV['RAILS_RELATIVE_URL_ROOT'] | |
| path = ENV['RAILS_RELATIVE_URL_ROOT'] + path | |
| end | |
| path | |
| end | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment