Class: PhotoAlbumsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/photo_albums_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



7
8
9
10
11
12
13
14
# File 'app/controllers/photo_albums_controller.rb', line 7

def index
  @photo_albums = if @photo_gallery
                    @photo_gallery.albums.ordered
                  else
                    SpudPhotoAlbum.ordered
                  end
  respond_with @photo_albums
end

#showObject



16
17
18
19
20
21
22
23
# File 'app/controllers/photo_albums_controller.rb', line 16

def show
  @photo_album = SpudPhotoAlbum.find_by(url_name: params[:id])
  if @photo_album.blank?
    raise Spud::NotFoundError, item: 'photo album'
  else
    respond_with @photo_album
  end
end