Hi,
I’m using the code below to display some pagination links. It works
great apart from when there’s no paging i.e. the full collection is
displayed, when it still display a “1” to represent the current page.
How can I suppress that?
Thanks!
<% for page in @my_pages -%>
<%= link_to_unless(params[:page].to_i == page.number, page.number,
{:params => params.merge(‘page’ => page)},
{:class => “pagelink”}) {|link_name|
“<span class=“currentpage”>#{link_name}”} %>
<% end %>
<%= link_to(‘Next >’, {:params => params.merge(‘page’ =>
@my_pages.current.next)}, {:class => “nextlink”}) if
@my_pages.current.next %>