Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uninitialized constant WillPaginate::ActionView #187

Open
jdugarte opened this issue Jun 6, 2021 · 2 comments
Open

uninitialized constant WillPaginate::ActionView #187

jdugarte opened this issue Jun 6, 2021 · 2 comments

Comments

@jdugarte
Copy link
Contributor

jdugarte commented Jun 6, 2021

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
Copy link
Contributor

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
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants