Exception: AbstractController::ActionNotFound

Inherits:
StandardError
  • Object
show all
Includes:
DidYouMean::Correctable
Defined in:
lib/abstract_controller/base.rb

Overview

Raised when a non-existing controller action is triggered.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, controller = nil, action = nil) ⇒ ActionNotFound

:nodoc:



16
17
18
19
20
# File 'lib/abstract_controller/base.rb', line 16

def initialize(message = nil, controller = nil, action = nil) # :nodoc:
  @controller = controller
  @action = action
  super(message)
end

Instance Attribute Details

#actionObject (readonly)

:nodoc:



14
15
16
# File 'lib/abstract_controller/base.rb', line 14

def action
  @action
end

#controllerObject (readonly)

:nodoc:



14
15
16
# File 'lib/abstract_controller/base.rb', line 14

def controller
  @controller
end

Instance Method Details

#correctionsObject

:nodoc:



25
26
27
# File 'lib/abstract_controller/base.rb', line 25

def corrections # :nodoc:
  @corrections ||= DidYouMean::SpellChecker.new(dictionary: controller.class.action_methods).correct(action)
end