Use letter opener

This commit is contained in:
Paul Chavard 2018-09-25 11:54:15 +02:00
parent 5291e75bd6
commit ff9e87b88e
6 changed files with 20 additions and 14 deletions

View file

@ -164,6 +164,7 @@ group :development do
gem 'rubocop-rspec-focused', require: false gem 'rubocop-rspec-focused', require: false
gem 'haml-lint' gem 'haml-lint'
gem 'scss_lint', require: false gem 'scss_lint', require: false
gem 'letter_opener_web'
end end
group :development, :test do group :development, :test do

View file

@ -459,6 +459,12 @@ GEM
leaflet-markercluster-rails (0.7.0) leaflet-markercluster-rails (0.7.0)
railties (>= 3.1) railties (>= 3.1)
leaflet-rails (0.7.7) leaflet-rails (0.7.7)
letter_opener (1.6.0)
launchy (~> 2.2)
letter_opener_web (1.3.4)
actionmailer (>= 3.2)
letter_opener (~> 1.0)
railties (>= 3.2)
listen (3.1.5) listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4) rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7) rb-inotify (~> 0.9, >= 0.9.7)
@ -855,6 +861,7 @@ DEPENDENCIES
leaflet-draw-rails leaflet-draw-rails
leaflet-markercluster-rails (~> 0.7.0) leaflet-markercluster-rails (~> 0.7.0)
leaflet-rails leaflet-rails
letter_opener_web
lograge lograge
logstash-event logstash-event
mailjet mailjet
@ -906,4 +913,4 @@ DEPENDENCIES
zxcvbn-ruby zxcvbn-ruby
BUNDLED WITH BUNDLED WITH
1.16.4 1.16.5

View file

@ -1,3 +1,2 @@
server: bin/rails server server: bin/rails server
jobs: bin/delayed_job run jobs: bin/delayed_job run
mails: mailcatcher -f

View file

@ -13,9 +13,6 @@ chdir APP_ROOT do
# This script is a starting point to setup your application. # This script is a starting point to setup your application.
# Add necessary setup steps to this file. # Add necessary setup steps to this file.
puts '== Installing global tools =='
system! 'gem install mailcatcher --conservative'
puts "\n== Installing dependencies ==" puts "\n== Installing dependencies =="
system! 'gem install bundler --conservative' system! 'gem install bundler --conservative'
system('bundle check') || system!('bundle install') system('bundle check') || system!('bundle install')

View file

@ -45,17 +45,11 @@ Rails.application.configure do
config.assets.raise_runtime_errors = true config.assets.raise_runtime_errors = true
# Action Mailer settings # Action Mailer settings
config.action_mailer.delivery_method = :smtp config.action_mailer.delivery_method = :letter_opener_web
config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
# Config for mailcatcher https://mailcatcher.me/
config.action_mailer.smtp_settings = {
address: 'localhost',
port: 1025,
locale: 'fr'
}
Rails.application.routes.default_url_options = { Rails.application.routes.default_url_options = {
host: 'localhost:3000' host: 'localhost',
port: 3000
} }
# Raises error for missing translations # Raises error for missing translations

View file

@ -45,6 +45,14 @@ Rails.application.routes.draw do
root to: "administrateurs#index" root to: "administrateurs#index"
end end
#
# Letter Opener
#
if Rails.env.development?
mount LetterOpenerWeb::Engine, at: "/letter_opener"
end
# #
# Monitoring # Monitoring
# #