Class: MerbPhotos::Photos
- Inherits:
-
Application
- Object
- Merb::Controller
- Application
- MerbPhotos::Photos
- Defined in:
- app/controllers/photos.rb
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
5 6 7 8 9 10 11 |
# File 'app/controllers/photos.rb', line 5 def index @photosets = flickr.photosets.getList :user_id => user_id photoset_id = params[:photoset_id] || @photosets.first.id @photoset = flickr.photosets.getInfo(:photoset_id => photoset_id) @photos = flickr.photosets.getPhotos(:photoset_id => photoset_id).photo display @photosets end |
#photo ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'app/controllers/photos.rb', line 13 def photo @photoset_id = params[:photoset_id] @photo_id = params[:photo_id] sizes = flickr.photos.getSizes(:photo_id => params[:photo_id]) @photo = sizes.find {|s| s.label == 'Medium'} context = flickr.photosets.getContext(:photo_id => params[:photo_id], :photoset_id => params[:photoset_id]) @next_id = context.nextphoto.id unless context.nextphoto.id == 0 @previous_id = context.prevphoto.id unless context.prevphoto.id == 0 display(@photo, :layout => false) end |