This file contains 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
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" | |
} | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/" | |
} | |
export PS1='\u@\h \[\033[1;33m\]\w\[\033[0m\]$(parse_git_branch)$ ' |
This file contains 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) %> |
This file contains 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 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 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 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 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 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 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 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' |
OlderNewer