Method: ActionController::UrlGenerationError#corrections

Defined in:
actionpack/lib/action_controller/metal/exceptions.rb

#correctionsObject



41
42
43
44
45
46
47
48
# File 'actionpack/lib/action_controller/metal/exceptions.rb', line 41

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