module AppFrame::ControllerMethods::PaginationSupport

Public Instance Methods

collection() click to toggle source

paginate collection

# File lib/app_frame/controller_methods.rb, line 104
def collection
  get_collection_ivar || set_collection_ivar(end_of_association_chain ? end_of_association_chain.page(page).per(per_page) : nil)
end
count() click to toggle source
# File lib/app_frame/controller_methods.rb, line 116
def count
  @count ||= if end_of_association_chain
    end_of_association_chain.count 
  else
    0
  end
end
page() click to toggle source
# File lib/app_frame/controller_methods.rb, line 108
def page
  (params[:page] || 1).to_i
end
per_page() click to toggle source
# File lib/app_frame/controller_methods.rb, line 112
def per_page
  20
end