Forum: Ruby on Rails custom paginator generating Next link when not needed

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Da P. (Guest)
on 2006-01-27 22:42
I implemented a prefix search using the following custom paginator:

@performer_pages = self, Performer.count, 25,
@performers = Performer.find( :all,
          :conditions => ["Name >= ?", params[:prefix] ],
          :order => "Name ASC", :limit =>
          :offset => @performer_pages.current.offset )

The view (rhtml) creates the previous & next links like so:

<%= link_to 'Previous page', { :prefix => params[:prefix], :page =>
@performer_pages.current.previous } if @performer_pages.current.previous
<%= link_to 'Next page', { :prefix => params[:prefix], :page => } if %>

While this creates the previous link appropriately, it creates the
'next' link when one is not required (i.e., the result for the 'next'
page view is empty).

?:-\    Any ideas?  Thanks --
This topic is locked and can not be replied to.