lucasas/will_paginate_mongoid

will_paginate view helper not loading

jeremy6d opened this issue · 8 comments

When I use "will_paginate @pages" in my Rails 3.0.7 app with Mongoid 2.2.2, I get:

undefined method `will_paginate' for #<#Class:0x007fdc21a08980:0x007fdc21a03fc0>

if I include this at the top of my view:

require 'will_paginate/view_helpers/action_view'

Then everything works. Clearly, something is clobbering the Railtie file to prevent it from loading the view helper at load. Can't really figure out why it's failing, though. If you can provide insight into why this might be occurring, I'd appreciate it!

Hi jeremy6d,

The code works without Will Paginate Mongoid?

Thank you.

Yes, it works fine if I pull out will_paginate_mongoid. It's not calling that hook in the railtie to load the action view helper. If I put that require in my application_controller.rb all is well.

What version of will_paginate are you using?

3.0.2

  • Jeremy

On Mon, Jan 23, 2012 at 5:12 PM, Lucas Souza <
reply@reply.github.com

wrote:

What version of will_paginateare you using?


Reply to this email directly or view it on GitHub:

#2 (comment)

And what version of rails are you using?

3.0.7

  • Jeremy

On Mon, Jan 23, 2012 at 5:15 PM, Lucas Souza <
reply@reply.github.com

wrote:

And what version of rails are you using?


Reply to this email directly or view it on GitHub:

#2 (comment)

Fixed on version 1.0.2

Thanks for your attention to this. Unfortunately, I'm not on mongodb 2.0 so I can't upgrade to mongoid 2.4. My workaround will be enough for now. Thanks again!