better rounding
git-svn-id: http://svn.barleysodas.com/barleysodas/trunk@109 0f7b21a7-9e3a-4941-bbeb-ce5c7c368fa7master
parent
b41d0dc841
commit
c3ff8be124
|
@ -74,8 +74,7 @@ class TagImagesController < ApplicationController
|
|||
@current_page = params[:page].to_i
|
||||
@current_page = 1 if @current_page == 0
|
||||
image_count = TagImage.count(conditions)
|
||||
@page_count = (image_count.to_f / per_page.to_f + 0.5).to_i
|
||||
@page_count = 1 if @page_count == 0 and image_count >= 0
|
||||
@page_count = (image_count.to_f / images_per_page.to_f).round
|
||||
@tagged_images = TagImage.find :all, :limit => images_per_page,
|
||||
:conditions => conditions, :order => 'created_at ASC',
|
||||
:offset => ((@current_page - 1) * images_per_page),
|
||||
|
|
Reference in New Issue