# Redbox + will\_paginate

**URL:** <https://www.ruby-forum.com/t/redbox-will-paginate/135114>\
**Category:** Rails\
**Created:** [April 18, 2008, 12:43am UTC](https://www.ruby-forum.com/t/redbox-will-paginate/135114 "2008-04-18T00:43:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![softf5ajivanet](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9f8e36/32.png) [@softf5ajivanet](https://www.ruby-forum.com/u/softf5ajivanet)\
**Post date:** [April 18, 2008, 12:43am UTC](https://www.ruby-forum.com/t/redbox-will-paginate/135114/1 "2008-04-18T00:43:22Z")

</div>

Hiya,

I’m trying to use Will\_paginate with the RedBox plugin but having  
problems making it go to the next page of the collection.

[http://blog.craigambrose.com/articles/2006/09/22/redbox-release-2](http://blog.craigambrose.com/articles/2006/09/22/redbox-release-2)

as far as i can see will\_paginate does not support any kind of :remote  
ajax call so each page click can update the div element.

has anyone managed to get will\_paginate working within a redbox dialog?

appreciate it,

---

<div class="post-metadata">

**Author:** ![softf5ajivanet](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9f8e36/32.png) [@softf5ajivanet](https://www.ruby-forum.com/u/softf5ajivanet)\
**Post date:** [April 18, 2008, 12:44am UTC](https://www.ruby-forum.com/t/redbox-will-paginate/135114/2 "2008-04-18T00:44:59Z")

</div>

i found one way to get around it by creating a new remote\_link\_renderer  
helper and then coupling it to the will\_paginate call…

class RemoteLinkRenderer \< WillPaginate::LinkRenderer  
def initialize(collection, options, template)  
@remote = options.delete(:remote) || {}  
super  
end  
def page\_link\_or\_span(page, span\_class = ‘current’, text = nil)  
text ||= page.to\_s  
if page and page != current\_page  
@template.link\_to\_remote(text, {:url =\> url\_options(page), :method  
=\> :get}.merge(@remote))  
else  
@template.content\_tag :span, text, :class =\> span\_class  
end  
end  
end

but still didnt solve it moving to the next page of results…

\<%= will\_paginate @photos, :renderer =\> ‘RemoteLinkRenderer’%\>
