Skip to content

ActionView::Template::Error: Missing host to link to! #22

Open
@justinwiley

Description

@justinwiley

I'm using Rails 4.1, and getting:

ActionView::Template::Error:
       Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true

...when running on a template that contains asset paths. I was able to solve this by updating production.rb, development.rb etc to set Rails.application.routes.default_url_options:

Rails.application.routes.default_url_options = config.action_mailer.default_url_options = { :host => 'examplecom', :protocol => 'https' }

This seems to work, but since I can imagine this is a common issue, wondering if there's a better way?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions