Forum: Ruby on Rails pagination_links parameters?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Jason <> (Guest)
on 2005-12-11 04:04
I am using pagination_links to put simple pagination on my page 10
results at a time.  I am also wanting to put 'page:' in front of the
pagination numbers.  Only if there is less than 10 results the
pagination doesn't show so I don't want 'page:' to be there either.

This is what I've tried, but I thought there should be a way to do it in
the html_options in the method - though I can't find it in the Rdocs.

<p class="pagination">

<% if (pagination_links)%>
<strong>Pages:&nbsp;&nbsp;</strong>
<%end%>

<%= pagination_links(@news_item_pages) %>

</p>

Cheers,

Jason
Jason (Guest)
on 2006-01-05 09:09
Jason <removed_email_address@domain.invalid> wrote:

Hey, just bumping this up as I ran into this a long time ago and still
don't know if there is a solution.  Seems like it shouldn't be that hard
but I don't know it.

this is the code I am using:

<p class="pagination"><strong>Pages:&nbsp;&nbsp;</strong><%=
pagination_links(@location_pages) %></p>

so can I drop the 'Pages:' if the page hasn't reached the per page
limit?

> I am using pagination_links to put simple pagination on my page 10
> results at a time.  I am also wanting to put 'page:' in front of the
> pagination numbers.  Only if there is less than 10 results the
> pagination doesn't show so I don't want 'page:' to be there either.
>
> This is what I've tried, but I thought there should be a way to do it in
> the html_options in the method - though I can't find it in the Rdocs.
>
> <p class="pagination">
>
> <% if (pagination_links)%>
> <strong>Pages:&nbsp;&nbsp;</strong>
> <%end%>
>
> <%= pagination_links(@news_item_pages) %>
>
> </p>
>
> Cheers,
>
> Jason
This topic is locked and can not be replied to.