implements organizations search for admins

This commit is contained in:
Juanjo Bazán
2015-08-29 16:30:32 +02:00
parent 59c2fdb596
commit 0f1329fa85
7 changed files with 132 additions and 8 deletions

View File

@@ -2,13 +2,17 @@ class Admin::OrganizationsController < Admin::BaseController
before_filter :set_valid_filters, only: :index
before_filter :parse_filter, only: :index
load_and_authorize_resource
load_and_authorize_resource except: :search
def index
@organizations = @organizations.send(@filter)
@organizations = @organizations.includes(:user).order(:name, 'users.email').page(params[:page])
end
def search
@organizations = Organization.search(params[:term]).page(params[:page])
end
def verify
@organization.verify
redirect_to request.query_parameters.merge(action: :index)