metamaps--metamaps/app/helpers/users_helper.rb

22 lines
520 B
Ruby
Raw Permalink Normal View History

2012-09-23 02:39:12 +00:00
module UsersHelper
## 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
user['profile'] = u.image.url(:sixtyfour)
user['mapCount'] = u.maps.count
2014-10-01 22:07:05 +00:00
user['created_at'] = u.created_at.strftime("%m/%d/%Y")
user['rtype'] = "mapper"
temp.push user
end
return temp
end
2012-09-23 02:39:12 +00:00
end