Pagination problem

V

Vincent Hernandez

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.
 
C

Chen Ge

Vincent said:
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.
 
V

Vincent Hernandez

Chen said:
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 %>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,808
Messages
2,569,686
Members
45,452
Latest member
AmberLayde

Latest Threads

Top