Method: Admin::PostsController#destroy

Defined in:
app/controllers/admin/posts_controller.rb

#destroyObject



89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'app/controllers/admin/posts_controller.rb', line 89

def destroy
  @post = Effective::Post.find(params[:id])

  authorize_effective_posts!

  if @post.destroy
    flash[:success] = 'Successfully deleted post'
  else
    flash[:danger] = 'Unable to delete post'
  end

  redirect_to effective_posts.admin_posts_path
end