Skip to content

Instantly share code, notes, and snippets.

@etagwerker
Forked from juggy/assets.rb
Created July 8, 2011 12:31
Show Gist options
  • Save etagwerker/1071728 to your computer and use it in GitHub Desktop.
Save etagwerker/1071728 to your computer and use it in GitHub Desktop.
env["REQUEST_PATH"] may be nil
ActionController::Base.asset_host = Proc.new { |source, request|
if request.env["REQUEST_PATH"] && request.env["REQUEST_PATH"].include?(".pdf")
"file://#{Rails.root.join('public')}"
else
"#{request.protocol}#{request.host_with_port}"
end
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment