title: Ruby on Rails how to get current URL?
body: <p>I'm trying to get the current url in rails using <code>request.host</code>, <code>request.url</code> but I have a website that are in 2 domains, so:</p>
  
  <p>when I'm at <code>www.example1.com</code> the <code>request.host</code> or .url show <code>www.example1.com</code></p>
  
  <p>when I'm  at <code>www.example2.com</code> the <code>request.host</code> or .url show <code>example1.com</code>
  because the example2 is getting all content from example1 and showing in the example2(parsed)</p>
  
  <p>because the request.host get really the host, and request.url getting the host also
  I'm really need the get the url in the browser don't the host, someone can help?</p>
  
  <p>OBs: I'm using rails 4 and ruby 2
  OBs2: request.domain don't works, this return just ".com" of url</p>