bootstrap-ruby / will_paginate-bootstrap

Integrates the Twitter Bootstrap pagination component with will_paginate
MIT License
388 stars 160 forks source link

Add padrino support #33

Open renich opened 10 years ago

renich commented 10 years ago

Even, though, Padrino is a superset of Sinatra, the gem is not working in it.

This example made it work: https://gist.github.com/phildionne/5785087

n40lab commented 9 years ago

I know this is and old issue but I've succedeed using will_paginate-bootstrap with Padrino.

I've added the following to my boot.rb (using DataMapper ORM):

Padrino.before_load do require 'will_paginate/data_mapper' require "bootstrap_pagination/sinatra" end

Also I've added the following to my app.rb: register WillPaginate::Sinatra

I'm a Ruby/Padrino newbie so maybe it's not the best way to do this, but thanks to those lines I can use the will_paginate-bootstrap to paginate my results. I've tried to register the Sinatra

Great gem indeed! Thx

CyberFerret commented 8 years ago

Thank you @n40lab for pointing out the critical line above. I didn't have require 'bootstrap_pagination/sinatra' in my boot.rb under Padrino.before_load, and I was getting a App::BootstrapPagination::Sinatra undefined error. Adding this line fixed it, and the pagination works beautifully. Would have been a 5 minute task if not for this issue! As you said - great gem indeed.