Getting will_paginate to work with lightbox gone wild
In order to get will_paginate to work with lightbox gone wild, I had to make the following modifications:
Step 1
Modify lightbox.js
Add next, prev, start functions similiar to the example shown to the lightbox.js file
1 2 3 4 5 | next: function(e){ link = Event.element(e); Element.remove($('lbContent')); var myAjax = new Ajax.Request( link.href, {method: 'post', parameters: "", onComplete: this.processInfo.bindAsEventListener(this)} ); }, |
Step 2
Create a new method inside application_helper.rb.
1 2 3 4 5 6 7 8 9 10 | def will_paginate_modified object, params begin doc = Hpricot(will_paginate object, :params => {:id => params[:id]}) (doc/"a").set("class", "lbAction") (doc/"a").set("rel", "next") doc.html rescue Exception => e will_paginate object, :params => {:id => params[:id]} end end |
Step 3
Call will_paginate_modified from your lightbox gone wild pop up view file.
1 | <%= will_paginate_modified @my_collection, params %> |