Skip to content

Instantly share code, notes, and snippets.

@douglascamata
Created July 29, 2012 02:54
Show Gist options
  • Select an option

  • Save douglascamata/3195859 to your computer and use it in GitHub Desktop.

Select an option

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
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