From 7fd2de464e83744d63d4cb6614f3dafd1cca582f Mon Sep 17 00:00:00 2001 From: Anton Davydov Date: Tue, 3 Mar 2015 01:12:30 +0300 Subject: [PATCH] [ci skip] Add documentation for Helpers#all_helpers_from_path --- actionpack/lib/action_controller/metal/helpers.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/actionpack/lib/action_controller/metal/helpers.rb b/actionpack/lib/action_controller/metal/helpers.rb index a9c3e438fb..819837e767 100644 --- a/actionpack/lib/action_controller/metal/helpers.rb +++ b/actionpack/lib/action_controller/metal/helpers.rb @@ -93,6 +93,10 @@ module ActionController super(args) end + # Return a list of helper names in specific path. + # + # ActionController::Base.all_helpers_from_path 'app/helpers' + # # => ["application", "chart", "rubygems"] def all_helpers_from_path(path) helpers = Array(path).flat_map do |_path| extract = /^#{Regexp.quote(_path.to_s)}\/?(.*)_helper.rb$/