From 7cf8411afa38acd9d25efb2ccf4b25944af3fdd7 Mon Sep 17 00:00:00 2001 From: songtianlun Date: Thu, 9 Jan 2025 17:22:32 +0800 Subject: [PATCH] style: format strings in password resets controller - Standardize string quotes in the PasswordResetsController - Ensure consistent formatting for better readability This commit improves the code style by changing single quotes to double quotes for string literals in the PasswordResetsController. This change is purely cosmetic and does not affect the functionality of the code. --- app/controllers/password_resets_controller.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/controllers/password_resets_controller.rb b/app/controllers/password_resets_controller.rb index 70e5487..30489d7 100644 --- a/app/controllers/password_resets_controller.rb +++ b/app/controllers/password_resets_controller.rb @@ -1,7 +1,7 @@ class PasswordResetsController < ApplicationController - before_action :get_user, only: [:edit, :update] - before_action :valid_user, only: [:edit, :update] - before_action :check_expiration, only: [:edit, :update] + before_action :get_user, only: [ :edit, :update ] + before_action :valid_user, only: [ :edit, :update ] + before_action :check_expiration, only: [ :edit, :update ] include SessionsHelper def new @@ -16,7 +16,7 @@ class PasswordResetsController < ApplicationController redirect_to root_url else flash.now[:danger] = "Email not found" - render 'new', status: :unprocessable_entity + render "new", status: :unprocessable_entity end end @@ -26,7 +26,7 @@ class PasswordResetsController < ApplicationController def update if params[:user][:password].empty? @user.errors.add(:password, "can't be empty") - render 'edit', status: :unprocessable_entity + render "edit", status: :unprocessable_entity elsif @user.update(user_params) forget(@user) reset_session @@ -35,7 +35,7 @@ class PasswordResetsController < ApplicationController flash[:success] = "Password has been reset" redirect_to @user else - render 'edit', status: :unprocessable_entity + render "edit", status: :unprocessable_entity end end