manuca / roda-will_paginate Goto Github PK
View Code? Open in Web Editor NEWPlugin to integrate Will Paginate with the Roda framework
License: MIT License
Plugin to integrate Will Paginate with the Roda framework
License: MIT License
I'm unable to figure out how to get the plugin to work. I've created a test Roda/Sequel/Postgres app. Gem is installed and plugin :will_paginate
added. Routes have this;
r.root do
@posts = Post.reverse_order(:created_at).paginate(page: 1)
view("homepage")
end
And the view is like this;
<% @posts.each do |post| %>
<!-- STUFF -->
<% end %>
<%= will_paginate @posts %>
This gives the error;
NoMethodError: undefined method `paginate' for Post:Class
Okay, perhaps I need the Sequel pagination plugin; DB.extension(:pagination)
and change the .paginate
to;
@posts = Post.reverse_order(:created_at).paginate(1, 10)
But this doesn't work either;
NoMethodError: undefined method `total_pages' for #<#<Class:0x007fa7fb6255e8>:0x007fa7fb4f4f48>
Obviously I'm doing something wrong, I just don't know what. Can you help?
I have a simple blog-like Roda/Sequel test app; I've include the gem in the Gemfile and added plugin :will_paginate
to app.rb, but when I rackup
I get the following errors;
.../roda-will_paginate-0.0.3/lib/roda/plugins/will_paginate.rb:11: warning: toplevel constant WillPaginate referenced by Roda::WillPaginate
.../roda-will_paginate-0.0.3/lib/roda/plugins/will_paginate.rb:11:in `configure': uninitialized constant WillPaginate::LinkRenderer (NameError)
Do you have any idea why?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.