will_paginate icon indicating copy to clipboard operation
will_paginate copied to clipboard

'uninitialized constant WillPaginate::ActionView::LinkRenderer' with custom renderer in dev mode after changes

Open JasonBarnabe opened this issue 10 months ago • 3 comments

I have a custom renderer:

require 'will_paginate/view_helpers/action_view'

module WillPaginate
  module ActionView
    class LinkRendererWithNoFollow < LinkRenderer
      def rel_value(_page)
        'nofollow'
      end
    end
  end
end

Works fine in production. Works fine in dev until I make any change to a controller, model, etc., and then I get this stacktrace until I restart puma:

NameError - uninitialized constant WillPaginate::ActionView::LinkRenderer:
  lib/will_paginate/action_view/link_renderer_with_no_follow.rb:6:in `<module:ActionView>'
  lib/will_paginate/action_view/link_renderer_with_no_follow.rb:5:in `<module:WillPaginate>'
  lib/will_paginate/action_view/link_renderer_with_no_follow.rb:4:in `<main>'
  app/helpers/application_helper.rb:1:in `<main>'
  app/controllers/application_controller.rb:1:in `<main>'
  app/controllers/home_controller.rb:1:in `<main>'

I believe this started happening after upgrading to Rails 8.

JasonBarnabe avatar Mar 16 '25 23:03 JasonBarnabe