diff options
author | Zachary Scott <e@zzak.io> | 2015-03-02 14:51:58 -0800 |
---|---|---|
committer | Zachary Scott <e@zzak.io> | 2015-03-02 14:51:58 -0800 |
commit | 3d69222ca971d1053b69558bbc4977c1acb6d6cb (patch) | |
tree | 6660317cd85f112cecfbd902386d14d447247f7b | |
parent | 0132a39260872af224707f7aa1aedd0dfa176f96 (diff) | |
parent | 7fd2de464e83744d63d4cb6614f3dafd1cca582f (diff) | |
download | rails-3d69222ca971d1053b69558bbc4977c1acb6d6cb.tar.gz rails-3d69222ca971d1053b69558bbc4977c1acb6d6cb.tar.bz2 rails-3d69222ca971d1053b69558bbc4977c1acb6d6cb.zip |
Merge pull request #19181 from davydovanton/update-helper-docs
[ci skip] Add documentation for Helpers#all_helpers_from_path
-rw-r--r-- | actionpack/lib/action_controller/metal/helpers.rb | 4 |
1 files changed, 4 insertions, 0 deletions
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$/ |