Thursday, November 05, 2015

Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true rails 4.2.4

In application.rb, inside the class add:

Rails.application.routes.default_url_options[:host] =  "load url that is appropriate for different environments in your app here"

Now you can go to the rails console:

 > include Rails.application.routes.url_helpers

and call different url_helpers like this: