| Class | Admin::CommentsController |
| In: |
app/controllers/admin/comments_controller.rb
|
| Parent: | Admin::BaseController |
DELETE /comments/1 DELETE /comments/1.xml
# File app/controllers/admin/comments_controller.rb, line 76
76: def destroy
77: @comment = Comment.find(params[:id])
78: @comment.destroy
79:
80: respond_to do |format|
81: format.html { redirect_to(admin_comments_path) }
82: format.xml { head :ok }
83: end
84: end
GET /comments/1/edit
# File app/controllers/admin/comments_controller.rb, line 36
36: def edit
37: @comment = Comment.find(params[:id])
38: end
GET /comments GET /comments.xml
# File app/controllers/admin/comments_controller.rb, line 4
4: def index
5: @comments = Comment.page_find
6:
7: respond_to do |format|
8: format.html # index.html.erb
9: format.xml { render :xml => @comments }
10: end
11: end
GET /comments/1 GET /comments/1.xml
# File app/controllers/admin/comments_controller.rb, line 15
15: def show
16: @comment = Comment.find(params[:id])
17:
18: respond_to do |format|
19: format.html # show.html.erb
20: format.xml { render :xml => @comment }
21: end
22: end
PUT /comments/1 PUT /comments/1.xml
# File app/controllers/admin/comments_controller.rb, line 59
59: def update
60: @comment = Comment.find(params[:id])
61:
62: respond_to do |format|
63: if @comment.update_attributes(params[:comment])
64: flash[:notice] = 'Comment was successfully updated.'
65: format.html { redirect_to(admin_comment_path(@comment)) }
66: format.xml { head :ok }
67: else
68: format.html { render :action => 'edit' }
69: format.xml { render :xml => @comment.errors, :status => :unprocessable_entity }
70: end
71: end
72: end