class ActionController::UrlGenerationError

:nodoc:

def corrections

def corrections
  @corrections ||= begin
    maybe_these = routes&.named_routes&.helper_names&.grep(/#{route_name}/) || []
    maybe_these -= [method_name.to_s] # remove exact match
    DidYouMean::SpellChecker.new(dictionary: maybe_these).correct(route_name)
  end
end

def initialize(message, routes = nil, route_name = nil, method_name = nil)

def initialize(message, routes = nil, route_name = nil, method_name = nil)
  @routes      = routes
  @route_name  = route_name
  @method_name = method_name
  super(message)
end