This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Article < ActiveRecord::Base | |
| # ... | |
| define_index do | |
| #los indexes tienen que ser datos del tipo string | |
| indexes title, :sortable => true | |
| indexes entry | |
| indexes author.name, :as => :author, :sortable => true | |
| #los atributos pueden ser integer, boolean o datetime |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| WillPaginate::ViewHelpers.pagination_options[:renderer] = 'PaginationListLinkRenderer' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <%= will_paginate(@users, :renderer => PaginationListLinkRenderer) %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <%= will_paginate(@users, :renderer => PaginationListLinkRenderer) %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class VbsLinkRenderer < WillPaginate::LinkRenderer | |
| def to_html | |
| links = @options[:page_links] ? windowed_links : [] | |
| links.unshift(page_link_or_span(@collection.previous_page, 'prev', @options[:previous_label])) | |
| links.push(page_link_or_span(@collection.next_page, 'next', @options[:next_label])) | |
| html = links.join(@options[:separator]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <ul class="pagination"> | |
| <li class="previous"><a href="/users?page=1">« Previous</a></li> | |
| <li><a href="/users?page=1">1</a></li> | |
| <li class="current">2</li> | |
| <li><a href="/users?page=3">3</a></li> | |
| <li class="next"><a href="/users?page=3">Next »</a></li> | |
| </ul> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <ul class="pagination"> | |
| <li class="previous"><a href="/users?page=1">« Previous</a></li> | |
| <li><a href="/users?page=1">1</a></li> | |
| <li class="current">2</li> | |
| <li><a href="/users?page=3">3</a></li> | |
| <li class="next"><a href="/users?page=3">Next »</a></li> | |
| </ul> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .pagination { | |
| padding: 3px; | |
| margin: 3px; | |
| } | |
| .pagination a { | |
| padding: 2px 5px 2px 5px; | |
| margin: 2px; | |
| border: 1px solid #aaaadd; | |
| text-decoration: none; | |
| color: #666; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="pagination"><span class="disabled prev_page">« Previous</span> <span class="current">1</span> <a href="/users?page=2" rel="next">2</a> <a href="/users?page=3">3</a> <a href="/users?page=2" class="next_page" rel="next">Next »</a></div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # En el controlador | |
| @users = User.paginate(:page => params[:page]) | |
| # En la vista | |
| <%= will_paginate(@users) %> |