Skip to content

Instantly share code, notes, and snippets.

@lmarburger
Forked from krazylegz/gist:223573
Created November 1, 2009 16:41
Show Gist options
  • Save lmarburger/223574 to your computer and use it in GitHub Desktop.
Save lmarburger/223574 to your computer and use it in GitHub Desktop.
#friends = Array.new
#current_user.connections.each do |c|
#friends.push([c.friend.full_name, c.user_id])
friends = current_user.connections.map do |c|
[ c.friend.full_name, c.user_id ]
end
friends = friends.sort do |a, b|
a[0] <=> b[0]
end
# friends = current_user.connections.map { |c| c.friend.full_name }.sort { |a,b| a.downcase <=> b.downcase }
f.select :receiver_id, friends
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment