Browse the Ruby on Rails Community.

You are here: Forums Ask a Rails expert Cutomize Will_Paginate next & ...

Replytotopic

Cutomize Will_Paginate next & previouse links

Posted in Forums : Ask a Rails expert

 
Photo

Authority 0
Posting Rating 0
Sign in to rate this post

Hello All ,
i have a question how i can customize the will_paginate next and previous buttons to be rendered as follow

Previous link <content rendered be to> Next Link

so i will be able to scrolling the <content rendered be to> are using those links ?

 
Me

Authority 62
Posting Rating 100
Sign in to rate this post

Everything you can customize without monkey patching in WillPaginate is inside the class variable WillPaginate::ViewHelpers::pagination_options. Take a look at the options and see if it has what you need. If you need help then come back here and ask again.

HTH

 
100_5106-785540

Authority 25
Posting Rating 0
Sign in to rate this post

Hi Hosam,

to elaborate a little on what Clemens said, add these two lines to your environment.rb file:

WillPaginate::ViewHelpers.pagination_options[:prev_label] = ‘the page before the one you are looking at right now, dude’
WillPaginate::ViewHelpers.pagination_options[:next_label] = ‘I do not like this page, take me to the next one’

Make sure you put them outside the Rails::Initializer block.

- Johannes

Replytotopic

Other Recent Topics

Ask a Rails expert : Routing problem using patterns for id

Ask a Rails expert : How to work with ror 2.1.1 using Netbeans IDE 6.1

Ask a Rails expert : json gem error

Ask a Rails expert : Problem with break

Ask a Rails expert : activesupport string first method error

Ask a Rails expert : url_for broken ?

Ask a Rails expert : map.routes.rb pls help

Ask a Rails expert : how to h tag in controller

Ask a Rails expert : Problem with Restful routing and partial form

Ask a Rails expert : will_paginate, search and ajax

Formatting Help
  • *bold*       _italics_      
    bq. (quotes)
  • "DSC":http://www.dsc.net
  • * or # (lists)
or cancel