Created
January 6, 2011 22:05
-
-
Save juggy/768696 to your computer and use it in GitHub Desktop.
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
ActionController::Base.asset_host = Proc.new { |source, request| | |
if request.env["REQUEST_PATH"].include? ".pdf" | |
"file://#{Rails.root.join('public')}" | |
else | |
"#{request.protocol}#{request.host_with_port}" | |
end | |
} |
If you use the OP's method:
consider using this instead
if request.path.include? ".pdf"
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for the gist!
Here is correct version with slash at the end for root_url option. Works for me too on heroku.