Bug fix#11
Open
wiskerpaddy wants to merge 4 commits intoDaichiSaito:bugfrom
Open
Conversation
DaichiSaito
reviewed
Feb 29, 2024
| @@ -1,10 +1,11 @@ | |||
| class SessionsController < ApplicationController | |||
|
|
|||
| protect_from_forgery | |||
Author
There was a problem hiding this comment.
いりませんでした。確認漏れてました。。。消して上げなおします
Owner
Author
目的「プラクティス-デバッグ方法を身につける」課題1ー3の修正対応 達成条件「プラクティス-デバッグ方法を身につける」の期待値通りに動作すること 実装の概要課題1「ログインができない」原因・修正内容:配列の指定が間違っていた(userがnilになっていた)ので配列の指定を修正。# app/controllers/sessions_controller.rb
# 修正前
user = User.find_by(email: params[:email])
# 修正後
user = User.find_by(email: params[:session][:email])
課題2「ログインしているはずなのにログイン必須の画面にアクセスできない」原因・修正内容:User.find_by()で指定していたカラムが存在しなかったため、適切なカラムを指定。# app/controllers/application_controller.rb
# 修正前
@current_user ||= User.find_by(id: session[:id]) if session[:user_id].present?
# 修正後
@current_user ||= User.find_by(id: session[:user_id]) if session[:user_id].present?課題3「Postの投稿ができない」原因・修正内容: 存在しないHTML属性を指定(誤記)したため、適切なHTML属性を指定。<!-- app/views/posts/_form.html.erb -->
<!-- 修正前 -->
<%= form.text_field :titlee %>
<!-- 修正後 -->
<%= form.text_field :title %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


課題1~3まで対応しました。ご確認お願いします