Class: Blogit::CommentsController
- Inherits:
-
ApplicationController
show all
- Defined in:
- app/controllers/blogit/comments_controller.rb
Instance Method Summary
(collapse)
blogit_authenticate, blogit_cacher, blogit_conf, #blogit_conf, blogit_sweeper, #current_blogger, #this_blogger?
Instance Method Details
- (Object) create
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'app/controllers/blogit/comments_controller.rb', line 9
def create
@comment = post..new(params[:comment])
respond_to do |format|
format.js {
@comment.save
}
format.html {
if @comment.save
redirect_to(post, notice: t(:successfully_added_comment, scope: 'blogit.comments'))
else
render "blogit/posts/show"
end
}
end
end
|
- (Object) destroy
29
30
31
32
33
34
35
36
|
# File 'app/controllers/blogit/comments_controller.rb', line 29
def destroy
@comment = post..find(params[:id])
@comment.destroy
respond_to do |format|
format.html { redirect_to(post, notice: t(:successfully_removed_comment, scope: 'blogit.comments'))}
format.js
end
end
|