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 PaginationListLinkRenderer < WillPaginate::LinkRenderer | |
def to_html | |
links = @options[:page_links] ? windowed_links : [] | |
html = links.join(@options[:separator]) | |
@options[:container] ? @template.content_tag(:ul, html, html_attributes) : html | |
end | |
protected | |
def windowed_links |
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 PaginationListLinkRenderer < WillPaginate::LinkRenderer | |
def to_html | |
links = @options[:page_links] ? windowed_links : [] | |
html = links.join(@options[:separator]) | |
@options[:container] ? @template.content_tag(:ul, html, html_attributes) : html | |
end | |
protected | |
def windowed_links |
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/john/komentarze?page=2" rel="next">2</a> | |
<a href="/users/john/komentarze?page=3">3</a> | |
<a href="/users/john/komentarze?page=4">4</a> | |
<a href="/users/john/komentarze?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
<ul class="pagination"> | |
<li class="select">1</li> | |
<li><a href="/users/john/komentarze?page=2">2</a></li> | |
<li><a href="/users/john/komentarze?page=3">3</a></li> | |
<li><a href="/users/john/komentarze?page=4">4</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="select">1</li> | |
<li><a href="/users/john/komentarze?page=2">2</a></li> | |
<li><a href="/users/john/komentarze?page=3">3</a></li> | |
<li><a href="/users/john/komentarze?page=4">4</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
will_paginate @comments, | |
:prev_label => '« poprzedni', | |
:next_label => 'następny »' |
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
{"email" => "moj@mejl.pl", "amp;name" => "Stefan"} |
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
module ActionController | |
class AbstractRequest | |
class << self | |
def parse_query_parameters(query_string) | |
return {} if query_string.blank? | |
query_string = query_string.gsub("amp;", "") | |
pairs = query_string.split('&').collect do |chunk| | |
next if chunk.empty? | |
key, value = chunk.split('=', 2) |
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
<%= cache('your_cache_key', :expires_in => 3.hours) do %> | |
<!-- computation heavy stuff goes here %> | |
<% end %> |
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
config.middleware.use Rack::Bug, | |
:secret_key => "moje_tajne_haslo", | |
:panel_classes => [ | |
Rack::Bug::TimerPanel, | |
Rack::Bug::ActiveRecordPanel, | |
Rack::Bug::CachePanel, | |
Rack::Bug::SQLPanel, | |
Rack::Bug::TemplatesPanel, | |
Rack::Bug::LogPanel, | |
Rack::Bug::MemoryPanel |
OlderNewer