Class: Gallery::PhotosController

Inherits:
ApplicationController show all
Defined in:
app/controllers/gallery/photos_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



11
12
13
14
15
16
17
18
19
20
# File 'app/controllers/gallery/photos_controller.rb', line 11

def index
  album = Album.find_by_id(params[:album_id])
  album = Album.find_by_uid_and_provider(params[:album_id].split('-').first, params[:album_id].split('-').last) unless album
  photos = album.photos
  if album.public
    respond_with photos, :only => [:id, :album_id, :source, :name, :aspect_ratio, :thumbnail]
  else
    respond_with []
  end
end