Rails: get hostname in initializer
I am using Sorcery for authentication and I need to set up third party authentication in its initializer.
The initializer has a string that looks like this:
is the hostname when I use Pow in local development. This should be the
case if the app is in production, or
if it is in production, etc.
I would like to set this line like this:
is the only method I know of this and this is only available at the controller level.
I can use a conditional test and manually configure the hostname for each environment, but as I test in different local and staging environments, it would be great to just set this up programmatically.
source to share