Skip to content
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

Set action_mailer.default_url_options values in development and test #51191

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions railties/CHANGELOG.md
@@ -1,3 +1,10 @@
* Set `action_mailer.default_url_options` values in `development` and `test`.

Prior to this commit, new Rails applications would raise `ActionView::Template::Error`
if a mailer included a url built with a `*_path` helper.

*Steve Polito*

* Introduce `Rails::Generators::Testing::Assertions#assert_initializer`

Compliments the existing `initializer` generator action.
Expand Down
Expand Up @@ -43,6 +43,8 @@ Rails.application.configure do
config.action_mailer.raise_delivery_errors = false

config.action_mailer.perform_caching = false

config.action_mailer.default_url_options = { host: "localhost", port: 3000 }
<%- end -%>

# Print deprecation notices to the Rails logger.
Expand Down
Expand Up @@ -44,6 +44,10 @@ Rails.application.configure do
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test

# Unlike controllers, the mailer instance doesn't have any context about the
# incoming request so you'll need to provide the :host parameter yourself.
config.action_mailer.default_url_options = { host: "www.example.com" }

<%- end -%>
# Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr
Expand Down