diff options
author | Azul <azul@leap.se> | 2012-11-26 16:34:46 +0100 |
---|---|---|
committer | Azul <azul@leap.se> | 2012-11-26 16:34:46 +0100 |
commit | 51ba799f98113b7112f2968fc80e4d291924b3bf (patch) | |
tree | 257c1a21251b526c02b3cf1ef825384ef25cee51 /users/app/assets | |
parent | bf74255d1530fe5852dc6e6c27ef975ce9aa8d3c (diff) |
basic users index with typeahead search
Diffstat (limited to 'users/app/assets')
-rw-r--r-- | users/app/assets/javascripts/users.js.coffee | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/users/app/assets/javascripts/users.js.coffee b/users/app/assets/javascripts/users.js.coffee index f0bb3dd..61d4121 100644 --- a/users/app/assets/javascripts/users.js.coffee +++ b/users/app/assets/javascripts/users.js.coffee @@ -21,6 +21,9 @@ srp.error = (message) -> else alert(message) +pollUsers = (query, process) -> + $.get( "/users.json", query: query).done(process); + $(document).ready -> $('#new_user').submit preventDefault $('#new_user').submit srp.signup @@ -28,4 +31,5 @@ $(document).ready -> $('#new_session').submit srp.login $('.user.form.edit').submit srp.update $('.user.form.edit').submit preventDefault + $('.user.typeahead').typeahead({source: pollUsers}); |