Skip to content

Commit

Permalink
Remove white spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Tshobohwa committed Jul 15, 2023
1 parent 8bfb819 commit 6e1d353
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions app/controllers/api/comments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@ def index
user = User.find(params[:user_id])
post = user.posts.find(params[:post_id])
comments = post.comments

render json: comments
end

def create
post = Post.find(params[:post_id])
comment = post.comments.build(comment_params)
comment.user = current_user

if comment.save
render json: comment, status: :created
else
Expand Down

0 comments on commit 6e1d353

Please sign in to comment.