refactoring

This commit is contained in:
albert
2011-06-12 16:41:23 -04:00
parent 033f0fc266
commit d6e4283cc7
41 changed files with 197 additions and 429 deletions

View File

@@ -36,6 +36,14 @@ module PostSets
@page ||= params[:page] ? params[:page].to_i : 1
end
def total_pages
(count / limit.to_f).ceil
end
def current_page
page
end
def offset
((page < 1) ? 0 : (page - 1)) * limit
end