views:

35

answers:

1

Hello!

I need to retrieve 5 random favorites photos from a flickr profile.

I've got perfect Moonpix-Flickr Gem to work with Flickr API.

And it works great, by using method .favorites I can get full list of user's favorites photos.

It returns as Flickr::PhotoCollection and I don't know how to get 5 random records from it.

Thanks in advance!

A: 

Sorry, guys, I've just had a hit

user.favorites.sort_by{rand}[0..4]
Sergei