-
Notifications
You must be signed in to change notification settings - Fork 0
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
Comments #17
Comments #17
Conversation
…age.Users can create comments on article page.
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.
Just some thoughts about limiting the number of displayed comments
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.
A few more things. Also, it does not look like you added any tests or seeds around comments. Should definitely do both of those things.
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.
A couple other small things
@@ -0,0 +1,22 @@ | |||
class CommentsController < ApplicationController | |||
before_action :authorized, only: [:create] |
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.
create
is the only action in this controller, so the only
is unnecessary.
config/routes.rb
Outdated
@@ -1,6 +1,8 @@ | |||
Rails.application.routes.draw do | |||
root "articles#index" | |||
resources :articles | |||
resources :articles do | |||
resources :comments, only: [:create, :index] |
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.
The comments controller doesn't have an index action, so I would either remove this index route or add a corresponding action and view.
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.
LGTM
Each article page lists all comments. Users can comment on each article page.