123456789_123456789_123456789_123456789_123456789_

Exception: ActionController::UrlGenerationError

Do not use. This class is for internal use only.
Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, ActionControllerError, StandardError
Instance Chain:
self, DidYouMean::Correctable, ActionControllerError, StandardError
Inherits: ActionController::ActionControllerError
Defined in: actionpack/lib/action_controller/metal/exceptions.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(message, routes = nil, route_name = nil, method_name = nil) ⇒ UrlGenerationError

[ GitHub ]

  
# File 'actionpack/lib/action_controller/metal/exceptions.rb', line 28

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

  super(message)
end

Instance Attribute Details

#method_name (readonly)

[ GitHub ]

  
# File 'actionpack/lib/action_controller/metal/exceptions.rb', line 26

attr_reader :routes, :route_name, :method_name

#route_name (readonly)

[ GitHub ]

  
# File 'actionpack/lib/action_controller/metal/exceptions.rb', line 26

attr_reader :routes, :route_name, :method_name

#routes (readonly)

[ GitHub ]

  
# File 'actionpack/lib/action_controller/metal/exceptions.rb', line 26

attr_reader :routes, :route_name, :method_name

Instance Method Details

#corrections

[ GitHub ]

  
# File 'actionpack/lib/action_controller/metal/exceptions.rb', line 39

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