Browse files

fixes

  • Loading branch information...
1 parent f62878e commit 8a4e78a41d0bec03d3954f42c7f092fc7f284cb3 @glebm glebm committed Feb 15, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/overrides/premailer/premailer.rb
View
4 lib/overrides/premailer/premailer.rb
@@ -7,12 +7,12 @@
# This override handles these cases, while falling back to the default implementation.
def load_css_from_local_file_with_rails_path!(path)
# Remove query string and the path
- clean_path = path.sub(/\?.*$/, '').sub(%r(^https?://[^/]*), '')
+ clean_path = path.sub(/\?.*$/, '').sub(%r(^https?://[^/]*/), '')
rails_path = Rails.root.join('public', clean_path)
if File.exist?(rails_path)
load_css_from_string(File.read(rails_path))
elsif (asset = Rails.application.assets.find_asset(clean_path.sub("#{Rails.configuration.assets.prefix}/", '')))
- load_css_from_string(asset.to_s)
+ load_css_from_string(asset.source)
else
load_css_from_local_file_without_rails_path!(path)
end

0 comments on commit 8a4e78a

Please sign in to comment.