Class: ViewAlbumsController

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

Instance Method Summary collapse

Instance Method Details

#indexObject



4
5
6
# File 'app/controllers/view_albums_controller.rb', line 4

def index
@albums = Album.page(params[:search], params[:page])
end

#showObject



8
9
10
11
12
13
14
15
16
# File 'app/controllers/view_albums_controller.rb', line 8

def show
if Album.find_by_filename(params[:filename]) == nil
	@album = Album.find(:first)
	render :file => "#{RAILS_ROOT}/public/404.html", :layout => false, :status => 404
else
	@album = Album.find_by_filename(params[:filename])
	@photos = @album.photos.page(params[:search], params[:page])
end
end