foodsoft/app/controllers/admin/users_controller.rb

16 lines
452 B
Ruby
Raw Normal View History

class Admin::UsersController < Admin::BaseController
2011-06-09 22:03:27 +02:00
inherit_resources
def index
@users = User.order('nick ASC')
2011-06-09 22:03:27 +02:00
# if somebody uses the search field:
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
@users = @users.page(params[:page]).per(@per_page)
end
end