<%= pagination_links(@pages) %>, next/previos link

hi, im trying to get next and previous page links but how?

i saw this:

<%= link_to “Previous page”, { :page => paginator.current.previous } if
paginator.current.previous %>

<%= link_to “Next page”, { :page => paginator.current.next } if
paginator.current.next %>

but dont know how to get it configured with what i have.

this is my function i use…

def paginate_collection(collection, options = {})
logger.debug "----~CALLING PAGIONATE!!!== "
default_options = {:per_page => 1, :page => 1}
options = default_options.merge options

pages = Paginator.new self, collection.size, options[:per_page], 

options[:page]
first = pages.current.offset
last = [first + options[:per_page], collection.size].min
slice = collection[first…last]
return [pages, slice]
end

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs