I'm trying to get the current url in rails using request.host
, request.url
but I have a website that are in 2 domains, so:
when I'm at www.example1.com
the request.host
or .url show www.example1.com
when I'm at www.example2.com
the request.host
or .url show example1.com
because the example2 is getting all content from example1 and showing in the example2(parsed)
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?
OBs: I'm using rails 4 and ruby 2 OBs2: request.domain don't works, this return just ".com" of url