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
rafaelfranca
merged 2 commits into
rails:main
from
stevepolitodesign:sp-action-mailer-default-url-options
Feb 27, 2024
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though we can set this to anything, I felt it was important to keep it consistent with what Rails is served on, in an effort to make previews link to the application.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sounds like a helpful change—thanks! Quick question: The
bin/rails server
command allows a--port XXXX
flag (and withbin/dev
you set it via an env var, e.g.PORT=XXXX bin/dev
). Any reason not to use that value, with a default of3000
? I ask because I often use that flag when I have multiple rails apps running.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a great observation. I think we'd somehow need access to the value set in
Rails::Commands::Server::ServerCommand
:rails/railties/lib/rails/commands/server/server_command.rb
Lines 213 to 215 in bf8e0f5
I attempted the following implementation, but if
ENV["PORT"]
is not set, it won't match what's passed to the--port
flag.However, this seemed to work for the following cases:
ENV["PORT"]
is supplied--port
is supplied.ENV["PORT"]
nor--port
is supplied (defaulting to3000
)