Skip to content

Instantly share code, notes, and snippets.

@noahhendrix
Created July 30, 2010 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noahhendrix/501174 to your computer and use it in GitHub Desktop.
Save noahhendrix/501174 to your computer and use it in GitHub Desktop.
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'
WillPaginate::ViewHelpers.pagination_options[:renderer] = "ProperPagination"
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