ruby on rails *_url returning wrong address
I'm sending emails from rails, and using the *_url helper to generate urls.
However, these links are starting:
http开发者_Python百科s://admin.test.website.co.uk/
(which is what the URL used to start with), whereas they should start:
https://production.test.website.co.uk/
Anyone know what could be going wrong..?
What I think is going on is that you send the e-mails from your admin-interface. When using a generated _url helper, the host is generated from your current host, if present. If you want to override this, you can specify the host yourself using a variable or even hard-code it.
So, for example, instead of using page_url
, you could use page_url(:host => 'https://production.test.website.co.uk/')
Good luck!
精彩评论