Class: Tracebook::CommentsController
Instance Method Summary
collapse
#current_tracebook_user_label, #render_not_found
Instance Method Details
21
22
23
|
# File 'app/controllers/tracebook/comments_controller.rb', line 21
def
params.require(:comment).permit(:body)
end
|
#create ⇒ Object
5
6
7
8
9
10
11
12
13
14
15
16
17
|
# File 'app/controllers/tracebook/comments_controller.rb', line 5
def create
chat = Tracebook.config.chat_model.find(params[:chat_id])
review = ChatReview.for_chat(chat)
= review..build()
.author = current_tracebook_user_label
if .save
redirect_to chat_path(chat), notice: "Comment added"
else
redirect_to chat_path(chat), alert: "Failed to add comment"
end
end
|