Method: AbstractController::Helpers::ClassMethods#inherited
- Defined in:
- lib/abstract_controller/helpers.rb
#inherited(klass) ⇒ Object
When a class is inherited, wrap its helper module in a new module. This ensures that the parent class’s module can be changed independently of the child class’s.
21 22 23 24 25 26 |
# File 'lib/abstract_controller/helpers.rb', line 21 def inherited(klass) helpers = _helpers klass._helpers = Module.new { include helpers } klass.class_eval { default_helper_module! unless anonymous? } super end |