Skip to content

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

@JasonBarnabe

Description

@JasonBarnabe

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions