2012-09-23 02:39:12 +00:00
|
|
|
module UsersHelper
|
2014-01-29 03:46:58 +00:00
|
|
|
|
|
|
|
## this one is for building our custom JSON autocomplete format for typeahead
|
|
|
|
def autocomplete_user_array_json(users)
|
|
|
|
temp = []
|
|
|
|
users.each do |u|
|
|
|
|
user = {}
|
|
|
|
user['id'] = u.id
|
|
|
|
user['label'] = u.name
|
2014-02-05 03:03:24 +00:00
|
|
|
user['value'] = u.name
|
2014-09-03 23:05:25 +00:00
|
|
|
user['profile'] = u.image.url(:thumb)
|
2014-01-29 03:46:58 +00:00
|
|
|
user['mapCount'] = u.maps.count
|
2014-02-02 19:56:07 +00:00
|
|
|
user['rtype'] = "mapper"
|
2014-01-29 03:46:58 +00:00
|
|
|
|
|
|
|
temp.push user
|
|
|
|
end
|
|
|
|
return temp
|
|
|
|
end
|
|
|
|
|
2012-09-23 02:39:12 +00:00
|
|
|
end
|