diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 4b3fda052..acbfdd4d9 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -46,7 +46,7 @@ class ApplicationController < ActionController::Base def render_403(style = 'danger') respond_to do |format| format.html do - render file: 'public/403.html', status: :forbidden, layout: false + render 'errors/403', status: :forbidden, layout: false end format.json do render json: { style: style }, status: :forbidden @@ -60,7 +60,7 @@ class ApplicationController < ActionController::Base def render_404 respond_to do |format| format.html do - render file: 'public/404.html', status: :not_found, layout: false + render 'errors/404', status: :not_found, layout: false end format.json do render json: {}, status: :not_found @@ -74,7 +74,7 @@ class ApplicationController < ActionController::Base def render_422(message = t('client_api.permission_error')) respond_to do |format| format.html do - render file: 'public/422.html', status: :unprocessable_entity, layout: false + render 'errors/422', status: :unprocessable_entity, layout: false end format.json do render json: { message: message }, status: :unprocessable_entity diff --git a/app/views/errors/403.html.erb b/app/views/errors/403.html.erb new file mode 100644 index 000000000..2152c64b4 --- /dev/null +++ b/app/views/errors/403.html.erb @@ -0,0 +1,118 @@ + + +
+<%= t("errors.forbidden.dialog.text") %>
+ + + + <%= t("errors.forbidden.dialog.button") %> + +<%= t("errors.not_found.dialog.text_1") %>
+<%= t("errors.not_found.dialog.text_2_html", home_url: root_url, search_url: new_search_url) %>
+<%= t("errors.unprocessable_entity.dialog.text") %>
+