Class: ViewAlbumsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ViewAlbumsController
- Defined in:
- app/controllers/view_albums_controller.rb
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
4 5 6 |
# File 'app/controllers/view_albums_controller.rb', line 4 def index @albums = Album.page(params[:search], params[:page]) end |
#show ⇒ Object
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 |