instance method
all_helpers_from_path
Ruby on Rails 6.0.6
Since v3.1.12 Last seen in v7.0.10Signature
all_helpers_from_path(path)
Returns a list of helper names in a given path.
ActionController::Base.all_helpers_from_path 'app/helpers' # => ["application", "chart", "rubygems"]
Parameters
-
pathreq
Source
# File actionpack/lib/action_controller/metal/helpers.rb, line 101
def all_helpers_from_path(path)
helpers = Array(path).flat_map do |_path|
names = Dir["#{_path}/**/*_helper.rb"].map { |file| file[_path.to_s.size + 1..-"_helper.rb".size - 1] }
names.sort!
end
helpers.uniq!
helpers
end
Defined in actionpack/lib/action_controller/metal/helpers.rb line 101
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionController::Helpers::ClassMethods