Created
July 30, 2010 19:32
-
-
Save noahhendrix/501174 to your computer and use it in GitHub Desktop.
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
ActionView::Template::Error (uninitialized constant ProperPagination): | |
37: </table> | |
38: | |
39: <div class="pagination"> | |
40: <%= proper_will_paginate @paginated_contacts %> | |
41: </div> | |
42: </div> | |
43: | |
app/helpers/layout_helper.rb:39:in `proper_will_paginate' | |
app/views/contacts/index.html.erb:40:in `block in _app_views_contacts_index_html_erb__3698943926993382814_2167932380_4560130947360283155' | |
app/helpers/layout_helper.rb:88:in `block (2 levels) in content_box' | |
app/helpers/layout_helper.rb:87:in `block in content_box' | |
app/helpers/layout_helper.rb:86:in `content_box' | |
app/views/contacts/index.html.erb:3:in `_app_views_contacts_index_html_erb__3698943926993382814_2167932380_4560130947360283155' |
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] = "ProperPagination" |
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 ProperPagination < WillPaginate::ViewHelpers | |
def page_number(page) | |
unless page == current_page | |
link(page, page, :rel => rel_value(page)) | |
else | |
@template.content_tag(:li, tag(:strong, page).html_safe, :class => "current") | |
end | |
end | |
def previous_or_next_page(page, text, classname) | |
if page | |
link(text, page, :class => classname) | |
else | |
tag(:li, text, :class => classname + ' disabled') | |
end | |
end | |
def html_container(html) | |
tag(:ul, html, container_attributes) | |
end | |
def link(text, target, attributes = {}) | |
if target.is_a? Fixnum | |
attributes[:rel] = rel_value(target) | |
target = url(target) | |
end | |
attributes[:href] = target | |
@template.content_tag(:li, tag(:a, text, attributes).html_safe) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment