Class: Jabe::CommentsController
Instance Method Summary
collapse
included, #public_entry_url
#body_class_name, included
Instance Method Details
#create ⇒ Object
9
10
11
12
13
14
15
16
17
18
19
|
# File 'app/controllers/jabe/comments_controller.rb', line 9
def create
.request = request
.permalink = public_entry_url(entry)
if .save
redirect_to public_entry_url(entry), :notice => 'Your comment was submitted.'
else
flash[:error] = 'Unable to submit your comment.'
render 'entries/show'
end
end
|
#destroy ⇒ Object
21
22
23
24
25
26
27
28
29
|
# File 'app/controllers/jabe/comments_controller.rb', line 21
def destroy
.destroy
if request.xhr?
render :nothing => true
else
redirect_to entry_path(entry), :notice => 'Comment was deleted.'
end
end
|