yrgoldteeth / bootstrap-will_paginate

Format will_paginate html to match Twitter Bootstrap styling

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

undefined method `total_pages' for nil:NilClass

mhartl opened this issue · comments

I get the error undefined method 'total_pages' for nil:NilClass when leaving off an explicit argument to will_paginate. In other words, if @users contains a (paginated) list of users on the Users index page, the code

<%= will_paginate(@users) %>

works fine, but the equivalent code

<%= will_paginate %>

raises the error above.

I'm considering bootstrap-will_paginate for inclusion in the Ruby on Rails Tutorial, 2nd Edition, so it would be awesome if you could fix this issue, for the sake of newbies everywhere.

Ah, I've not used the simplified syntax before. I'll take a look at this today. Thanks for the report!

That should do it.

ab7c0cb

I got the same error.