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
- #method_name readonly
- #route_name readonly
- #routes readonly
Instance Method Summary
Constructor Details
.new(message, routes = nil, route_name = nil, method_name = nil) ⇒ UrlGenerationError
# File 'actionpack/lib/action_controller/metal/exceptions.rb', line 30
def initialize(, routes = nil, route_name = nil, method_name = nil) @routes = routes @route_name = route_name @method_name = method_name super( ) end
Instance Attribute Details
#method_name (readonly)
[ GitHub ]# File 'actionpack/lib/action_controller/metal/exceptions.rb', line 28
attr_reader :routes, :route_name, :method_name
#route_name (readonly)
[ GitHub ]# File 'actionpack/lib/action_controller/metal/exceptions.rb', line 28
attr_reader :routes, :route_name, :method_name
#routes (readonly)
[ GitHub ]# File 'actionpack/lib/action_controller/metal/exceptions.rb', line 28
attr_reader :routes, :route_name, :method_name
Instance Method Details
#corrections
[ GitHub ]# 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