How to set config.action_controller.default_url_options = {:host = '#''} on per environment basis

前端 未结 7 852
再見小時候
再見小時候 2020-12-12 22:20

Right now I\'m using this which works for the development host, but I have to manually change the {:host => \"\"} code when I move to production.

post.rb



        
相关标签:
7条回答
  • 2020-12-12 23:23

    For me whats worked is

    ActionMailer::Base.default_url_options = { host: "yourhosthere"} # e.g. yourhosthere=localhost:3000 or yourhosthere=example.com
    

    because if you already set a port in the config files then changing the [:host] only will result in an error

    TypeError (no implicit conversion of Symbol into Integer):
    
    0 讨论(0)
提交回复
热议问题