diff options
author | Benjamin Neff <benjamin@coding4coffee.ch> | 2022-07-17 23:29:59 +0300 |
---|---|---|
committer | Benjamin Neff <benjamin@coding4coffee.ch> | 2022-07-20 22:26:58 +0300 |
commit | 17b84d3dddd2dcb9d1a0e7f203f4776f80539186 (patch) | |
tree | 4bf3edab8e346e443af244f133b4ff7161797a78 /app | |
parent | b5a46cf7bbd5e9a857e26443a40b5b1a6b696cb1 (diff) |
Fix rendering of error pages to remove deprecation warning for rails 6.0
Diffstat (limited to 'app')
-rw-r--r-- | app/views/errors/error_404.haml | 5 | ||||
-rw-r--r-- | app/views/errors/error_422.haml | 6 | ||||
-rw-r--r-- | app/views/errors/error_500.haml | 6 | ||||
-rw-r--r-- | app/views/layouts/error_page.haml | 9 |
4 files changed, 8 insertions, 18 deletions
diff --git a/app/views/errors/error_404.haml b/app/views/errors/error_404.haml index 847b92ef6..d04dbef99 100644 --- a/app/views/errors/error_404.haml +++ b/app/views/errors/error_404.haml @@ -1,10 +1,5 @@ - content_for(:page_title) do The page you were looking for doesn't exist (404) -.transparent.big-number - 404 %h3 These are not the kittens you're looking for. Move along. -%p - %a{href: "javascript:history.back()"} - Go Back? diff --git a/app/views/errors/error_422.haml b/app/views/errors/error_422.haml index cd3af7d46..3c7ff409f 100644 --- a/app/views/errors/error_422.haml +++ b/app/views/errors/error_422.haml @@ -1,13 +1,7 @@ - content_for(:page_title) do The change you wanted was rejected (422) -.transparent.big-number - 422 %h3 The change you wanted was rejected. %p Maybe you tried to change something you didn't have access to. - -%p - %a{href: "javascript:history.back()"} - Go Back? diff --git a/app/views/errors/error_500.haml b/app/views/errors/error_500.haml index d566b86ca..61ed69e54 100644 --- a/app/views/errors/error_500.haml +++ b/app/views/errors/error_500.haml @@ -1,8 +1,6 @@ - content_for(:page_title) do We're sorry, but something went wrong (500) -.transparent.big-number - 500 %h3 Internal server error. Our bad! Sorry about that. :( @@ -10,7 +8,3 @@ - if AppConfig.admins.podmin_email? %p Drop us an email to <a href="mailto:#{AppConfig.admins.podmin_email}">#{AppConfig.admins.podmin_email}</a>. - -%p - %a{href: "javascript:history.back()"} - Go Back? diff --git a/app/views/layouts/error_page.haml b/app/views/layouts/error_page.haml index 258ce9cb3..15f7047ea 100644 --- a/app/views/layouts/error_page.haml +++ b/app/views/layouts/error_page.haml @@ -11,5 +11,12 @@ = yield(:head) - %body{class: "error-#{@code}", id: "error_#{@code}"} + %body{class: "error-#{local_assigns[:code]}", id: "error_#{local_assigns[:code]}"} + .transparent.big-number + = local_assigns[:code] + = yield + + %p + %a{href: "javascript:history.back()"} + Go Back? |