Commit 90af7f057b67a06deef7a2efc1d5f99f8590b6ba

Authored by LeandroNunes
1 parent 6a24a483

ActionItem19: fixing page parameter

git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@834 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/design_blocks/favorite_links/controllers/favorite_links_controller.rb
@@ -62,7 +62,7 @@ class FavoriteLinksController < ApplicationController @@ -62,7 +62,7 @@ class FavoriteLinksController < ApplicationController
62 end 62 end
63 63
64 def paginate_by_collection(collection, options = {}) 64 def paginate_by_collection(collection, options = {})
65 - page = ( params[:page] || 1).to_i 65 + page = params[:page].blank? ? 1 : params[:page].to_i
66 items_per_page = @design_block.limit_number 66 items_per_page = @design_block.limit_number
67 offset = (page - 1) * items_per_page 67 offset = (page - 1) * items_per_page
68 link_pages = Paginator.new(self, collection.size, items_per_page, page) 68 link_pages = Paginator.new(self, collection.size, items_per_page, page)