Created
June 1, 2013 21:42
-
-
Save hartct/5691816 to your computer and use it in GitHub Desktop.
Sample assets controller proxying some requests to S3
This file contains 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
class AssetsController < ApplicationController | |
def somename1 | |
uri = URI.parse "https://someurl2/#{params[:id]}.png" | |
response = Net::HTTP.get_response(uri) | |
send_data response.body, :type => 'image/png',:disposition => 'inline' | |
end | |
def somename2 | |
uri = URI.parse "https://someurl2/#{params[:id]}.png" | |
response = Net::HTTP.get_response(uri) | |
send_data response.body, :type => 'image/png',:disposition => 'inline' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment