From 67fd6cda40a8ac9c72f9a6bb08adbe32533846bf Mon Sep 17 00:00:00 2001 From: andrew Date: Fri, 1 Feb 2008 06:26:12 +0000 Subject: [PATCH] minimum number of pages git-svn-id: http://svn.barleysodas.com/barleysodas/trunk@113 0f7b21a7-9e3a-4941-bbeb-ce5c7c368fa7 --- app/controllers/tag_images_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/tag_images_controller.rb b/app/controllers/tag_images_controller.rb index 4039696..b0b33e2 100644 --- a/app/controllers/tag_images_controller.rb +++ b/app/controllers/tag_images_controller.rb @@ -75,6 +75,7 @@ class TagImagesController < ApplicationController @current_page = 1 if @current_page == 0 image_count = TagImage.count(conditions) @page_count = (image_count.to_f / images_per_page.to_f).round + @page_count = 1 if @page_count == 0 @tagged_images = TagImage.find :all, :limit => images_per_page, :conditions => conditions, :order => 'created_at ASC', :offset => ((@current_page - 1) * images_per_page),