Skip to content

Instantly share code, notes, and snippets.

@hartct
Created June 1, 2013 21:42
Show Gist options
  • Save hartct/5691816 to your computer and use it in GitHub Desktop.
Save hartct/5691816 to your computer and use it in GitHub Desktop.
Sample assets controller proxying some requests to S3
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