Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

추천한 항목을 취소할 수 있습니다 #32 #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mmx900
Copy link

@mmx900 mmx900 commented May 1, 2021

#32 를 처리합니다.

  • 추천한 항목을 다시 눌러 추천을 취소합니다.
  • 추천시에 글 작성자의 아이디가 두 번 표시되는 문제를 고칩니다.

@mmx900 mmx900 requested a review from rest515 May 1, 2021 10:27
@@ -25,7 +25,11 @@ def show
end

def vote
@article.liked_by current_user
if current_user.voted_for? @article
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

혹시 모르니 로그인 여부를 먼저 확인하면 어떨까요?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

코드에 참고할만한 내용을 못 찾아서, 가이드를 주시면 좋겠는데요.
그냥 위에 return unless user_signed_in? 한 줄 추가하면 될까요?
혹시 프레임웍을 사용중이거나 더 나은 방법이 있나 싶어서 여쭙니다.

Copy link

@dalikim dalikim May 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

before_action :authenticate_user!

이것처럼 하되 여기에 only: [:vote] 옵션을 주는 식으면 어떠려나요?

Copy link

@dalikim dalikim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

로그인 여부 체크는 대세에 중요한 부분이 아니니 그냥 배포하시죠

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants