23 lines
488 B
Ruby
23 lines
488 B
Ruby
module Paginators
|
|
class ForumPost < Base
|
|
attr_accessor :forum_posts
|
|
|
|
def initialize(forum_posts)
|
|
@forum_posts = forum_posts
|
|
end
|
|
|
|
protected
|
|
def total_pages
|
|
forum_posts.total_entries
|
|
end
|
|
|
|
def current_page
|
|
forum_posts.current_page
|
|
end
|
|
|
|
def paginated_link(template, page)
|
|
template.link_to(page, template.forum_posts_path(:search => template.params[:search], :page => page))
|
|
end
|
|
end
|
|
end
|