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:



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

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

Instance Attribute Details

#actionObject (readonly)

:nodoc:



12
13
14
# File 'lib/abstract_controller/base.rb', line 12

def action
  @action
end

#controllerObject (readonly)

:nodoc:



12
13
14
# File 'lib/abstract_controller/base.rb', line 12

def controller
  @controller
end

Instance Method Details

#correctionsObject

:nodoc:



23
24
25
# File 'lib/abstract_controller/base.rb', line 23

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