Skip to content

Commit 50bd22e

Browse files
committed
開発テスト環境にのみRambulanceマウント追加
1 parent ca186cb commit 50bd22e

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

config/routes.rb

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
# For details on the DSL available within this file,
33
# see http://guides.rubyonrails.org/routing.html
44

5+
# Rambulance を開発/テスト環境でのみマウント
6+
if Rails.env.development? || Rails.env.test?
7+
mount Rambulance::Engine => "/"
8+
end
9+
510
root "home#show"
611

712
# Render legal documents by using Keiyaku CSS
@@ -106,10 +111,9 @@
106111
# Check development sent emails
107112
mount LetterOpenerWeb::Engine, at: "/letter_opener" if Rails.env.development?
108113

109-
# 開発/テスト環境のみの便利ルート ──
110-
if Rails.env.development? || Rails.env.test?
111-
# Rambulance を開発/テスト環境でのみマウント
112-
mount Rambulance::Engine => "/"
113-
end
114+
# Rambulance がキャッチする /404, /422, /500
115+
match "/404", to: Rambulance::Engine, via: :all, defaults: { status_code: 404 }
116+
match "/422", to: Rambulance::Engine, via: :all, defaults: { status_code: 422 }
117+
match "/500", to: Rambulance::Engine, via: :all, defaults: { status_code: 500 }
114118

115119
end

0 commit comments

Comments
 (0)