Pagination problem

I have a filter function on my page so I can see the only records that I
want to but my problem is, in my pagination I only alot 100 record a
page and everytime I click the 2 or next it always brings me the 2nd
page of the whole record not the filtered ones.

···

--
Posted via http://www.ruby-forum.com/.

Vincent Hernandez wrote:

I have a filter function on my page so I can see the only records that I
want to but my problem is, in my pagination I only alot 100 record a
page and everytime I click the 2 or next it always brings me the 2nd
page of the whole record not the filtered ones.

better show your code.

···

--
Posted via http://www.ruby-forum.com/\.

Chen Ge wrote:

Vincent Hernandez wrote:

I have a filter function on my page so I can see the only records that I
want to but my problem is, in my pagination I only alot 100 record a
page and everytime I click the 2 or next it always brings me the 2nd
page of the whole record not the filtered ones.

better show your code.

<%= link_to 'Prev', { :page => @nercdb_pages.current.previous } if
@nercdb_pages.current.previous %>
    <% if @nercdb_pages.page_count > 100%>
      <%= pagination_links @nercdb_pages %>
      <%= link_to 'Next', { :page => @nercdb_pages.current.next } if
@nercdb_pages.current.next %>
    <% else %>
       <% for page in @nercdb_pages %>
       <%= link_to_unless(params[:page].to_i == page.number,
page.number,
            {:params => params.merge('page' => page)},
            {:class => 'linked_page'}) {|link_name| "<span
class='unlinked_page'>#{link_name}</span>"} %>&nbsp;
       <% end %>
       <%= link_to 'Next', { :page => @nercdb_pages.current.next } if
@nercdb_pages.current.next %>

···

--
Posted via http://www.ruby-forum.com/\.