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:
parent
2675a57fc3
commit
7fd2de464e
1 changed files with 4 additions and 0 deletions
|
@ -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$/
|
||||
|
|
Loading…
Reference in a new issue