-
-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ArgumentError (Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true) #49
Comments
I may be wrong, but I've also been trying to "fix" this today. Personally I set the host option in the relevant environment files.
|
I had to set the default host to fix this as well. |
If that's the best solution, maybe just the docs can be updated under 'URL Helpers' to include the configuration? |
I already have that setting, but it is slightly different, maybe that's it. This setting works for everything else, though, it just seems invisible inside a Notification class. config/environments/development.rb
|
Yeap, that solves it! config/environments/development.rb
I still didn't really get the difference between this and my previous setting. |
If you're going to try and access URLs in the console or in mailers, Rails requires you to set the default url options since it doesn't have a request to use the url from. Just standard Rails things, nothing specific to Noticed. Definitely a point of confusion since it's not very clear in Rails: rails/rails#29992 We can add a note to the readme though so people don't forget. |
Thanks for this! |
small side note, if you do the config changes, make sure to restart the server. Dealt with this issue and accepted solution seemed to not work, but restarting server after config did the trick. In case anyone ran into problem but didnt fix. |
I added the routes.default_url_options config in my config file, It is working fine locally but on staging/production its still throwing this error:
my config file looks like this:
anyone else still facing this issue? |
Trying to use url helpers to get the full url inside a Notification returns an error because, apparently, default_url_options is not defined inside a Notification object.
I fixed this by adding the following code inside my NewVideoNotification class.
Maybe this could be added to Noticed::Base.
The text was updated successfully, but these errors were encountered: