app/controllers/users_controller.rb
def confirm_destroy
    assert_params_must_have :id
    
    # Do not allow to remove admins
    if @user.is_admin?
      flash[:error] = "Admin can't be deleted"
      redirect_to :action => "list"
    end
    
  end
#
# Shows destroy confirmation form
# Admin is required to type username before destroy
# Administrators +can't+ be removed using this method
#

Shows destroy confirmation form
Admin is required to type username before destroy
Administrators +can't+ be removed using this method
Shows destroy confirmation form Admin is required to type username before destroy Administrators + can ' t + be removed using this method
def confirm_destroy
    assert_params_must_have :id
    if @user.is_admin?
      flash[:error] = "Admin can't be deleted"
      redirect_to :action => "list"
    end
  end
def confirm_destroy assert_params_must_have :id if @user . is_admin? flash [ :error ] = "Admin can't be deleted" redirect_to :action => "list" end end
Shows destroy confirmation form
Admin is required to type username before destroy
Administrators +can't+ be removed using this method
Shows destroy confirmation form Admin is required to type username before destroy Administrators + can ' t + be removed using this method
# Do not allow to remove admins
