app/controllers/users_controller.rb
##
# Destroy the user pass in args
#
# @param [ String ] id the id of user we want delete
#
Destroy the user pass in args
Destroy the user pass in args
def destroy
    if user == current_user
      flash[:error] = I18n.t('controllers.users.flash.destroy.error')
    else
      UserDestroy.new(user).destroy
      flash[:success] = I18n.t('controllers.users.flash.destroy.success', name: user.name)
    end
    redirect_to users_path
  end
def destroy if user == current_user flash [ :error ] = I18n . t ( 'controllers.users.flash.destroy.error' ) else UserDestroy . new ( user ) . destroy flash [ :success ] = I18n . t ( 'controllers.users.flash.destroy.success' , name : user . name ) end redirect_to users_path end
Destroy the user pass in args
Destroy the user pass in args
<not_specific>
id the id of user we want delete
id the id of user we want delete