Class: AlbumsController

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

Instance Method Summary collapse

Instance Method Details

#indexObject



3
4
5
# File 'app/controllers/albums_controller.rb', line 3

def index
  @albums = Album.published.desc.paginate(:page => params[:page], :per_page => 12)
end

#showObject



7
8
9
10
# File 'app/controllers/albums_controller.rb', line 7

def show
  @album = Album.find(params[:id])
  @photos = @album.photos.paginate(:page => params[:page], :per_page => 12)
end