1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

[ci skip] Add documentation for Helpers#all_helpers_from_path

This commit is contained in:
Anton Davydov 2015-03-03 01:12:30 +03:00
parent 2675a57fc3
commit 7fd2de464e

View file

@ -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$/