diff options
Diffstat (limited to 'guides/code/getting_started/app/controllers/posts_controller.rb')
-rw-r--r-- | guides/code/getting_started/app/controllers/posts_controller.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/guides/code/getting_started/app/controllers/posts_controller.rb b/guides/code/getting_started/app/controllers/posts_controller.rb index fc71e9b4e8..85d2c1de47 100644 --- a/guides/code/getting_started/app/controllers/posts_controller.rb +++ b/guides/code/getting_started/app/controllers/posts_controller.rb @@ -35,4 +35,11 @@ class PostsController < ApplicationController render 'edit' end end + + def destroy + @post = Post.find(params[:id]) + @post.destroy + + redirect_to :action => :index + end end |