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

Comment votes #26

Merged
merged 8 commits into from
Jul 1, 2024
Merged

Comment votes #26

merged 8 commits into from
Jul 1, 2024

Conversation

paulmckissock
Copy link
Contributor

Added comment voting.

Copy link
Contributor

@noahko96 noahko96 left a comment

Choose a reason for hiding this comment

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

A few little things

app/controllers/comments_controller.rb Outdated Show resolved Hide resolved
app/controllers/comments_controller.rb Outdated Show resolved Hide resolved
app/views/comments/show.html.erb Outdated Show resolved Hide resolved
app/views/comments/show.html.erb Show resolved Hide resolved
spec/controllers/comments_controller_spec.rb Outdated Show resolved Hide resolved
Copy link
Contributor

@noahko96 noahko96 left a comment

Choose a reason for hiding this comment

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

Still a couple more lines that need cleaned up.

Comment on lines 7 to 8
<%= button_to "Upvote", upvote_article_comment_path(comment), method: :post, class: "btn btn-sm upvote-button", data: { votable_type: 'Comment', votable_id: @comment.id, article_id: @comment.article.id } %>
<%= button_to "Downvote", downvote_article_comment_path(comment), method: :post, method: :post, class: "btn btn-sm downvote-button", data: { votable_type: 'Comment', votable_id: @comment.id, article_id: @comment.article.id } %>
Copy link
Contributor

Choose a reason for hiding this comment

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

You are still using @comment in these lines.

Copy link
Contributor

@noahko96 noahko96 left a comment

Choose a reason for hiding this comment

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

LGTM

@paulmckissock paulmckissock merged commit 7eef6a2 into main Jul 1, 2024
1 check passed
@paulmckissock paulmckissock deleted the comment-votes branch July 1, 2024 20:06
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