Class: AbstractController::ActionNotFound::Correction
- Inherits:
-
Object
- Object
- AbstractController::ActionNotFound::Correction
- Defined in:
- lib/abstract_controller/base.rb
Instance Method Summary collapse
- #corrections ⇒ Object
-
#initialize(error) ⇒ Correction
constructor
A new instance of Correction.
Constructor Details
#initialize(error) ⇒ Correction
Returns a new instance of Correction.
20 21 22 |
# File 'lib/abstract_controller/base.rb', line 20 def initialize(error) @error = error end |
Instance Method Details
#corrections ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/abstract_controller/base.rb', line 24 def corrections if @error.action maybe_these = @error.controller.class.action_methods maybe_these.sort_by { |n| DidYouMean::Jaro.distance(@error.action.to_s, n) }.reverse.first(4) else [] end end |