title: External Referrer URL in Rails 3 - from embedded script tag?
body: <p>I seem to be having a lot of trouble getting a URL referer for an external URL.</p>
  
  <p>My app runs through a script people include on their site:</p>
  
  <p>Like so- </p>
  
  <pre><code>&lt;script src="http://0.0.0.0:3000/load.js?upid=10b829af3eef17eb203667f5db56ef930eca062fde4a523b" type="text/javascript"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>When the page is hit and the script loads, its just matched to a controller action, where the upid is used to look up a record.</p>
  
  <p>That action looks like such:</p>
  
  <pre><code>  def remote
      @page = Page.find_by_upid(params[:upid])
      respond_to do |format|
        format.js
      end    
    end
  </code></pre>
  
  <p>I'm trying to now see the referring URL, as I want to see where that script tag was embedded.</p>
  
  <p>I have tried the following with 0 luck:</p>
  
  <pre><code>    logger.debug "r test: #{request.env['HTTP_REFERER']}"
      logger.debug "r test: #{request.referer}"
      logger.debug "r test: #{request.original_url}"
  </code></pre>
  
  <p>They all either return blank, or this URL <code>http://0.0.0.0:3000/load.js?upid=10b829af3eef17eb203667f5db56ef930eca062fde4a523b</code> from the script tag.</p>
  
  <p>Any help would be great</p>