# HG changeset patch # User Nattee Niparnan # Date 2016-10-11 14:52:11 # Node ID 970cebee99d609a9a5cc5c803125a34de84ef7cb # Parent b9b57b23f88d6bdc6e5f3bf4e12f9bc0d490fd11 fix destroy for user and problem (grafted from 56e542ecc72e8d85b776f34c64fe90d3ea4ae9e9) diff --git a/app/controllers/problems_controller.rb b/app/controllers/problems_controller.rb --- a/app/controllers/problems_controller.rb +++ b/app/controllers/problems_controller.rb @@ -11,11 +11,10 @@ end # GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html) - verify :method => :post, :only => [ :destroy, - :create, :quick_create, + verify :method => :post, :only => [ :create, :quick_create, :do_manage, :do_import, - ], + ], :redirect_to => { :action => :index } def show @@ -115,8 +114,8 @@ end def destroy - Problem.find(params[:id]).destroy - redirect_to action: :index + p = Problem.find(params[:id]).destroy + redirect_to action: :index end def toggle diff --git a/app/controllers/user_admin_controller.rb b/app/controllers/user_admin_controller.rb --- a/app/controllers/user_admin_controller.rb +++ b/app/controllers/user_admin_controller.rb @@ -7,7 +7,7 @@ before_filter :admin_authorization # GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html) - verify :method => :post, :only => [ :destroy, + verify :method => :post, :only => [ :create, :create_from_list, :update, :manage_contest,