Parent

Methods

Files

Thoth::ArchiveController

Public Instance Methods

index(page = 1) click to toggle source
# File lib/thoth/controller/archive.rb, line 41
def index(page = 1)
  page = page.to_i
  page = 1 unless page >= 1

  @posts = Post.recent(page, 10)

  if page > @posts.page_count && @posts.page_count > 0
    page = @posts.page_count
    @posts = Post.recent(page, 10)
  end

  @title = "#{Config.site.name} Archives (page #{page} of " <<
      "#{@posts.page_count > 0 ? @posts.page_count : 1})"

  @pager = pager(@posts)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.