| Class | CommentsController |
| In: |
test/functional/comments_controller_test.rb
app/controllers/comments_controller.rb |
| Parent: | Object |
Action destroy to delete a Comment-record.
# File app/controllers/comments_controller.rb, line 40
40: def destroy
41: cmt = Comment.find(params[:id])
42: wiki = cmt.site
43: cmt.destroy
44: flash['success'] = ::FLASH_RECORD_DELETED
45: redirect_to :controller => 'sites', :action => 'comments', :id => wiki.id
46: #redirect_to request.referer TODO If you use this, functional tests will fail
47: end
Action update to update a Comment-record.
# File app/controllers/comments_controller.rb, line 29
29: def update
30: @comment = Comment.find(params[:id])
31: if @comment.update_attributes(params[:comment])
32: flash['success'] = ::FLASH_RECORD_UPDATED
33: redirect_to @comment.request_referer
34: else
35: render :action => 'edit'
36: end
37: end