Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 7th, 2012  |  syntax: None  |  size: 0.47 KB  |  hits: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Rails proxy controller not pulling images through properly, how to modify appropriately?
  2. class ProxyController < ApplicationController
  3.   def get
  4.     url = URI.parse(params["url"])
  5.     result = Net::HTTP.get_response(url)
  6.       render :text => result.body
  7.   end
  8. end
  9.        
  10. get "proxy" => "proxy#get", :as => "proxy"
  11.        
  12. http://<my_dev_server>/proxy?url=http://<somedomain.tld>/path/to/page/images/image.jpg
  13.        
  14. http://<my_dev_server>/proxy?url=http://<somedomain.tld>/path/to/page