Skip to content

Commit

Permalink
Use letter_opener for dev email usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Shpigford committed Jan 2, 2024
1 parent d2aee87 commit 52857b2
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ group :development do

# Hotwire-based live reloading
gem "hotwire-livereload"

# letter_opener for catching and displaying emails sent during development
gem "letter_opener"
end

group :test do
Expand Down
5 changes: 5 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ GEM
activesupport (>= 5.0.0)
json (2.7.1)
language_server-protocol (3.17.0.3)
launchy (2.5.2)
addressable (~> 2.8)
letter_opener (1.8.1)
launchy (>= 2.2, < 3)
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
Expand Down Expand Up @@ -333,6 +337,7 @@ DEPENDENCIES
hotwire-livereload
importmap-rails
jbuilder
letter_opener
pg (~> 1.1)
puma (>= 5.0)
rails!
Expand Down
4 changes: 4 additions & 0 deletions app/views/pages/home.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div class="prose">
<h1>Home</h1>
<p><%= link_to "Sign out", destroy_user_session_path, method: :delete %></p>
</div>
4 changes: 3 additions & 1 deletion config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@
config.active_storage.service = :local

# Don't care if the mailer can't send.
config.action_mailer.delivery_method = :letter_opener
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = false
config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }

config.action_mailer.perform_caching = false

config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }

# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/devise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@
# config.navigational_formats = ['*/*', :html, :turbo_stream]

# The default HTTP method used to sign out a resource. Default is :delete.
config.sign_out_via = :delete
config.sign_out_via = :get

# ==> OmniAuth
# Add a new OmniAuth provider. Check the wiki for more information on setting
Expand Down

0 comments on commit 52857b2

Please sign in to comment.