-
Notifications
You must be signed in to change notification settings - Fork 2
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
base: master
Are you sure you want to change the base?
Conversation
@@ -25,7 +25,11 @@ def show | |||
end | |||
|
|||
def vote | |||
@article.liked_by current_user | |||
if current_user.voted_for? @article |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
혹시 모르니 로그인 여부를 먼저 확인하면 어떨까요?
There was a problem hiding this comment.
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?
한 줄 추가하면 될까요?
혹시 프레임웍을 사용중이거나 더 나은 방법이 있나 싶어서 여쭙니다.
There was a problem hiding this comment.
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] 옵션을 주는 식으면 어떠려나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
로그인 여부 체크는 대세에 중요한 부분이 아니니 그냥 배포하시죠
#32 를 처리합니다.