From 51ba799f98113b7112f2968fc80e4d291924b3bf Mon Sep 17 00:00:00 2001 From: Azul Date: Mon, 26 Nov 2012 16:34:46 +0100 Subject: basic users index with typeahead search --- users/app/assets/javascripts/users.js.coffee | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'users/app/assets') 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}); -- cgit v1.2.3