Module: RailsDevelopmentBoost::ViewHelpersPatch
- Defined in:
- lib/rails_development_boost/view_helpers_patch.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#add_template_helper_with_const_association_tracking(helper_module) ⇒ Object
we need to explicitly associate helpers to their including controllers/mailers.
Class Method Details
.apply! ⇒ Object
3 4 5 |
# File 'lib/rails_development_boost/view_helpers_patch.rb', line 3 def self.apply! AbstractController::Helpers::ClassMethods.send :include, self end |
.included(base) ⇒ Object
17 18 19 |
# File 'lib/rails_development_boost/view_helpers_patch.rb', line 17 def self.included(base) base.alias_method_chain :add_template_helper, :const_association_tracking end |
Instance Method Details
#add_template_helper_with_const_association_tracking(helper_module) ⇒ Object
we need to explicitly associate helpers to their including controllers/mailers
8 9 10 11 12 13 14 15 |
# File 'lib/rails_development_boost/view_helpers_patch.rb', line 8 def add_template_helper_with_const_association_tracking(helper_module) if DependenciesPatch::Util.anonymous_const?(helper_module) helper_module.ancestors.each {|ancestor| ActiveSupport::Dependencies.add_explicit_dependency(ancestor, self)} else ActiveSupport::Dependencies.add_explicit_dependency(helper_module, self) end add_template_helper_without_const_association_tracking(helper_module) end |