From 22ac296071523cf90f8f3ef828eb8d6815702d51 Mon Sep 17 00:00:00 2001 From: Alex Benoit Date: Mon, 31 Oct 2022 15:53:24 -0700 Subject: [PATCH] Add default error code to render calls Rails 7 adds error codes to validation errors, updated to match rails defaults https://github.com/rails/rails/commit/e83d7dcb2fc98fea3d726fde569001e400a050b1 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 143b397..a08863b 100644 --- a/README.md +++ b/README.md @@ -253,7 +253,7 @@ class SessionsController < ApplicationController redirect_to user else flash.now[:message] = "Please try again." - render :new + render :new, status: :unprocessable_entity end end @@ -277,7 +277,7 @@ class SessionsController < ApplicationController redirect_to result.user else flash.now[:message] = t(result.message) - render :new + render :new, status: :unprocessable_entity end end