Skip to content

Commit

Permalink
Adds pagination to resources
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.typosphere.org/typo/branches/rails_2@1582 820eb932-12ee-0310-9ca8-eeb645f39767
  • Loading branch information
Frédéric de Villamil committed Dec 21, 2007
1 parent 67cbbd7 commit 174e54c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/admin/resources_controller.rb
Expand Up @@ -72,7 +72,7 @@ def upload_status
def list
@r = Resource.new
@itunes_category_list = @r.get_itunes_categories
@resources_pages, @resources = paginate :resource, :per_page => 15, :order_by => "created_at DESC", :parameter => 'id'
@resources_pages, @resources = paginate :resource, :per_page => 15, :order_by => "created_at DESC", :parameter => 'page'
end

def index
Expand Down
6 changes: 6 additions & 0 deletions app/views/admin/resources/list.html.erb
Expand Up @@ -9,3 +9,9 @@
<div class="list" id="resources">
<%= render :partial => 'resources' -%>
</div>
<div class="paginate">
<%= link_to _("Previous page"), { :page => @resources_pages.current.previous } if @resources_pages.current.previous %>
<%= pagination_links(@resources_pages) %>
<%= link_to _("Next page"), { :page => @resources_pages.current.next } if @resources_pages.current.next %>
</div>

0 comments on commit 174e54c

Please sign in to comment.