summaryrefslogtreecommitdiff
path: root/users/app/controllers
diff options
context:
space:
mode:
authorjessib <jessib@leap.se>2012-11-26 10:22:48 -0800
committerjessib <jessib@leap.se>2012-11-26 10:22:48 -0800
commitba962a7d291c0d0a454a284dfb94ac35a3605e6a (patch)
tree873a6dc1b3cae51bbaa23329b238726dada1fd2d /users/app/controllers
parent3e744e4e226eae3ea2f900d9fccc32b6c046d65f (diff)
parentfa58393f4b665434830535b3e0c1a325c31ce03b (diff)
Merge branch 'develop' into help_develop
Diffstat (limited to 'users/app/controllers')
-rw-r--r--users/app/controllers/users_controller.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/users/app/controllers/users_controller.rb b/users/app/controllers/users_controller.rb
index 4912ac8..925b584 100644
--- a/users/app/controllers/users_controller.rb
+++ b/users/app/controllers/users_controller.rb
@@ -8,7 +8,13 @@ class UsersController < ApplicationController
respond_to :json, :html
def index
- @users = User.all
+ if params[:query]
+ @users = User.by_login.startkey(params[:query]).endkey(params[:query].succ)
+ else
+ @users = User.by_created_at.descending
+ end
+ @users = @users.limit(10)
+ respond_with @users.map(&:login).sort
end
def new