lml / commontator

A Rails engine for comments
MIT License
354 stars 99 forks source link

uninitialized constant WillPaginate::ActionView #187

Open jdugarte opened 3 years ago

jdugarte commented 3 years ago

I'm getting this error in production:

app/helpers/commontator/link_renderer.rb:1:in `<main>': uninitialized constant WillPaginate::ActionView (NameError)

and I can't figure out how to fix it. Any clues?

Rails: 6.1.3.2 Ruby: 2.7.3

ledzep443 commented 3 years ago

I was having this same issue, but I fixed it. Copy over the commontator helpers with the command "rails commontator:copy:helpers" then at the top of app/helpers/commontator/link_renderer.rb add

require 'will_paginate/view_helpers/link_renderer' require 'will_paginate/view_helpers/action_view'

I also changed WillPaginate::ActionView::LinkRenderer to WillPaginate::ViewHelpers::LinkRenderer and added will_paginate to my gemfile to make sure it got installed on the production server.

Hope this helps!!

ledzep443 commented 3 years ago

Works for me, so submitted a pull request. I'm using rails 6.1.4. Works with only adding the require statements, nothing else.