In un controller che io chiamo un servizio come:Dove impostare host per Rails.application.routes.url_helpers
MyService.call
Nel metodo MyService.call
voglio usare un aiutante URL:
Rails.application.routes.url_helpers.something_url
Tuttavia, ottengo l'errore:
Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true
in config/ambienti/development.rb ho:
config.action_mailer.default_url_options = { host: 'localhost:3000' }
config.action_controller.default_url_options = { host: 'localhost:3000' }
Cosa devo impostare per non ottenere l'errore?
Dove si trova "da qualche parte nel codice"? Forse questo aiuta: http://stackoverflow.com/questions/7219732/missing-host-to-link-to-please-provide-host-parameter-or-set-default-url-optio – Nobita