Class: PhotoAlbumsController

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

Instance Method Summary collapse

Instance Method Details

#indexObject



10
11
12
13
14
15
16
17
# File 'app/controllers/photo_albums_controller.rb', line 10

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

#showObject



19
20
21
22
23
24
25
26
# File 'app/controllers/photo_albums_controller.rb', line 19

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