Class: Notee::CommentsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Notee::CommentsController
- Defined in:
- app/controllers/notee/comments_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /comments.
- #show ⇒ Object
Instance Method Details
#create ⇒ Object
POST /comments
12 13 14 15 16 17 18 19 20 |
# File 'app/controllers/notee/comments_controller.rb', line 12 def create @comment = Comment.new(comment_params) if @comment.save render json: { status: 'success'} else render json: { status: 'failed'} end end |
#show ⇒ Object
6 7 8 9 |
# File 'app/controllers/notee/comments_controller.rb', line 6 def show @comments = Comment.where(post_id: params[:id]); render json: { status: 'success', comments: @comments} end |