フロントエンドプレイアブル
Some checks failed
CI / scan_ruby (push) Has been cancelled
CI / scan_js (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled
CI / system-test (push) Has been cancelled

This commit is contained in:
2026-02-15 14:57:17 +09:00
commit f25fd6f802
198 changed files with 10342 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
class SessionsController < ApplicationController
def new
end
def create
user = User.find_by(email: params[:email]&.downcase)
if user&.authenticate(params[:password])
session[:user_id] = user.id
flash[:notice] = "ログインしました"
redirect_to root_path
else
flash.now[:alert] = "メールアドレスまたはパスワードが正しくありません"
render :new, status: :unprocessable_entity
end
end
def destroy
session[:user_id] = nil
flash[:notice] = "ログアウトしました"
redirect_to root_path
end
end