Filter erased users and show erase reason in admin

This commit is contained in:
decabeza
2020-07-17 22:21:52 +02:00
parent 240cad793f
commit f72f255d15
6 changed files with 61 additions and 11 deletions

View File

@@ -1,8 +1,11 @@
class Admin::UsersController < Admin::BaseController
load_and_authorize_resource
has_filters %w[active erased], only: :index
def index
@users = User.by_username_email_or_document_number(params[:search]) if params[:search]
@users = @users.send(@current_filter)
@users = @users.by_username_email_or_document_number(params[:search]) if params[:search]
@users = @users.page(params[:page])
respond_to do |format|
format.html