2010-03-22 01:58:37 +01:00
|
|
|
class Admin::UsersController < Admin::BaseController
|
2011-06-09 22:03:27 +02:00
|
|
|
inherit_resources
|
|
|
|
|
2009-01-12 18:26:09 +01:00
|
|
|
def index
|
2012-09-30 21:15:55 +02:00
|
|
|
@users = User.order('nick ASC')
|
2011-06-09 22:03:27 +02:00
|
|
|
|
|
|
|
# if somebody uses the search field:
|
2012-10-15 21:19:17 +02:00
|
|
|
unless params[:user_name].blank?
|
|
|
|
@users = @users.where("first_name LIKE :user_name OR last_name LIKE :user_name OR nick LIKE :user_name",
|
|
|
|
user_name: "%#{params[:user_name]}%")
|
2011-06-09 22:03:27 +02:00
|
|
|
end
|
|
|
|
|
2012-10-15 21:19:17 +02:00
|
|
|
@users = @users.page(params[:page]).per(@per_page)
|
2009-01-12 18:26:09 +01:00
|
|
|
end
|
|
|
|
end
|