class ActionController::UrlGenerationError
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