Skip to content

Commit

Permalink
[ci skip] Add documentation for Helpers#all_helpers_from_path
Browse files Browse the repository at this point in the history
  • Loading branch information
davydovanton committed Mar 2, 2015
1 parent 2675a57 commit 7fd2de4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions actionpack/lib/action_controller/metal/helpers.rb
Expand Up @@ -93,6 +93,10 @@ def modules_for_helpers(args)
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$/
Expand Down

0 comments on commit 7fd2de4

Please sign in to comment.