のホストを設定するには:どこのようなサービスを呼び出すコントローラーでRails.application.routes.url_helpers
Rails.application.routes.url_helpers.something_url
:私は、URLヘルパーを使用したいMyService.call
方法で
MyService.call
しかし、私はエラーを取得する:私が持っている設定/環境/ development.rbで
Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true
:
config.action_mailer.default_url_options = { host: 'localhost:3000' }
config.action_controller.default_url_options = { host: 'localhost:3000' }
エラーを報告しないようにするにはどうすればよいですか?
「somewhere in the code」はどこですか?おそらく、これは役立ちます:http://stackoverflow.com/questions/7219732/missing-host-to-link-to-please-provide-host-parameter-or-set-default-url-optio – Nobita