simple_form with rspec requires default_url_options to be set

99 views
Skip to first unread message

Koen.

unread,
Mar 24, 2016, 12:48:46 PM3/24/16
to SimpleForm
When converting my forms from regular `form_for` to `simple_form_for` I ran into my specs errored with the following:

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

Now it turns out this can be quite easily fixed by adding this to my rspec helpers:

Rails.application.routes.default_url_options[:host] = 'test.host'

Although I don't understand why simple_form requires this, because when using regular form helpers it isn't required.

Reply all
Reply to author
Forward
0 new messages