Getting app comple URL based on the environment

I’m building an email with a URL on it that change depending on the
environment I’m at. For example http://localhost:3000/demo on
development and on production.

Is there any environment variable or method that could tell me the
complete URL of my web application? I’m looking for an alternative to
environment config files.

request.domain in your controller should do it


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs