-
-
Notifications
You must be signed in to change notification settings - Fork 108
Rambulanceを使って404/500/422ページを整備 #1702
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
Open
nacchan99
wants to merge
20
commits into
main
Choose a base branch
from
issue-1407-show-error-page
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+91
−16
Open
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
a39bdf6
Rambulance の導入と初期設定を追加
nacchan99 a4ce6e1
ErrorsController を新規作成(404/500/422用)
nacchan99 548d72a
500 Internal Server Error ページを追加
nacchan99 7c19b40
422 Unprocessable Entity ページを追加
nacchan99 a456487
エラーページ共通のヘッダー部分をパーシャル化
nacchan99 44d493b
共通パーシャル追加(フィードバック案内・Twitterタイムライン)※500/422は未確認
nacchan99 677d005
500/422エラーページの表示も確認済みに変更
nacchan99 62ad7c3
エラーページ(404/500/422)のリクエストテストを追加
nacchan99 4b52ff7
ErrorsControllerの不要なコメントを削除
nacchan99 7e4737c
コメント位置を上に移動して統一
nacchan99 9dac37e
errors/headerをインライン化し、partialを削除
nacchan99 c0d871a
errors/feedback_noticeをインライン化し、partialを削除
nacchan99 092c3dd
共通文言の表示確認テストをrequestspecに追加
nacchan99 8e7f468
refactor: 404・500・422 エラーページのルーティングを一元化
nacchan99 0103961
refactor: ErrorsController を show アクションに集約し旧アクションを削除
nacchan99 21dbe7b
refactor: エラーページのshow.htmlを新規作成しfooter_links_and_timelineパーシャルをインライン化
nacchan99 ee6d1de
refactor:不要になった旧エラービューとfooterパーシャルを削除
nacchan99 4e8612b
refactor:重複したroutes.drawブロックを削除しエラールーティングを昇順(404→422→500)に変更
nacchan99 2222744
refactor:application.rbからexceptions_app設定を削除しproduction/test環境へ移行
nacchan99 22c107b
feat: 開発/テスト環境向けのエラー確認ルートを追加
nacchan99 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
class ErrorsController < ApplicationController | ||
before_action :set_error_message | ||
|
||
def show | ||
render :show, status: @status_code | ||
end | ||
|
||
private | ||
|
||
def set_error_message | ||
@status_code = params[:status_code].to_i | ||
|
||
case @status_code | ||
when 404 | ||
@title = "ページが見つかりませんでした... 🥺💦" | ||
@desc = "ページが削除された可能性があります 🤔💭" | ||
when 422 | ||
@title = "リクエストが処理できませんでした… 😢" | ||
@desc = "入力内容に誤りがあるか、リクエストが正しく送信されなかった可能性があります。" | ||
when 500 | ||
@title = "予期しないエラーが発生しました 😵💫" | ||
@desc = "申し訳ありません。サーバーで問題が発生しています。" | ||
else | ||
@title = "予期せぬエラーが発生しました…😵" | ||
@desc = "しばらく経ってから再度お試しください。" | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<% provide(:title, "ページが見つかりませんでした... 🥺💦") %> | ||
<% provide(:desc, "ページが削除された可能性があります 🤔💭") %> | ||
<% provide(:title, @title) %> | ||
<% provide(:desc, @desc) %> | ||
|
||
<div id="top" class="title text-center"> | ||
<i class="cd cd-logo"></i> | ||
|
@@ -9,30 +9,41 @@ | |
</div> | ||
|
||
<section class="introduction text-center list"> | ||
<h2> | ||
ページが見つかりませんでした... 🥺💦 | ||
</h2> | ||
<h2><%= @title %></h2> | ||
<p> | ||
ページが削除された可能性があります 🤔💭 | ||
<%= @desc %> | ||
<br> | ||
</p> | ||
<p> | ||
フィードバックなどあれば [email protected] にメールしていただくか、 | ||
<br> | ||
もしくは | ||
<a href="https://github.com/coderdojo-japan/coderdojo.jp/issues/">GitHub Issue</a> | ||
<a href="https://github.com/coderdojo-japan/coderdojo.jp/issues/" target="_blank" rel="noopener"> | ||
GitHub Issue | ||
</a> | ||
に書いていただけると嬉しいです (>人< )✨ | ||
</p> | ||
</section> | ||
|
||
<section id="timeline" class="text-center grayscale-bg" style="padding-bottom: 100px;"> | ||
<br> | ||
<h3 class="text-center"> | ||
<a href="https://twitter.com/search?vertical=default&q=dojocon%20OR%20coderdojo%20OR%20%E3%82%B3%E3%83%BC%E3%83%80%E3%83%BC%E9%81%93%E5%A0%B4%20lang%3Aja" target="_blank" rel="noopener">🐣 最近の情報発信</a> | ||
<a href="https://twitter.com/search?vertical=default&q=dojocon%20OR%20coderdojo%20OR%20%E3%82%B3%E3%83%BC%E3%83%80%E3%83%BC%E9%81%93%E5%A0%B4%20lang%3Aja" | ||
target="_blank" rel="noopener"> | ||
🐣 最近の情報発信 | ||
</a> | ||
</h3> | ||
<br> | ||
<div class="twitter-timeline-wrapper"> | ||
<a class="twitter-timeline" href="https://twitter.com/CoderDojoJapan?ref_src=twsrc%5Etfw" data-lang="ja" data-chrome="noheader nofooter noborders" data-dnt="true" data-width="500" data-tweet-limit="5">@CoderDojoJapan アカウントのタイムライン</a> | ||
<a class="twitter-timeline" | ||
href="https://twitter.com/CoderDojoJapan?ref_src=twsrc%5Etfw" | ||
data-lang="ja" | ||
data-chrome="noheader nofooter noborders" | ||
data-dnt="true" | ||
data-width="500" | ||
data-tweet-limit="5"> | ||
@CoderDojoJapan アカウントのタイムライン | ||
</a> | ||
</div> | ||
<script async="" await="" src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> | ||
</section> | ||
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> | ||
</section> |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
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.
「子どものためのプログラミング道場」など、必ず表示されるテキストが存在するかも確認しておくと、さらに安心できそうです👍
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.
テストを追加しました🙌
092c3dd
よろしくお願いします!