Module: ActionView::ViewPaths
- Extended by:
- ActiveSupport::Concern
- Included in:
- Rendering
- Defined in:
- lib/action_view/view_paths.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
-
#_prefixes ⇒ Object
The prefixes used in render “foo” shortcuts.
-
#append_view_path(path) ⇒ Object
Append a path to the list of view paths for the current
LookupContext
. - #details_for_lookup ⇒ Object
-
#lookup_context ⇒ Object
LookupContext
is the object responsible for holding all information required for looking up templates, i.e. -
#prepend_view_path(path) ⇒ Object
Prepend a path to the list of view paths for the current
LookupContext
.
Class Method Details
.all_view_paths ⇒ Object
51 52 53 |
# File 'lib/action_view/view_paths.rb', line 51 def self.all_view_paths @all_view_paths.values.uniq end |
.get_view_paths(klass) ⇒ Object
43 44 45 |
# File 'lib/action_view/view_paths.rb', line 43 def self.get_view_paths(klass) @all_view_paths[klass] || get_view_paths(klass.superclass) end |
.set_view_paths(klass, paths) ⇒ Object
47 48 49 |
# File 'lib/action_view/view_paths.rb', line 47 def self.set_view_paths(klass, paths) @all_view_paths[klass] = paths end |
Instance Method Details
#_prefixes ⇒ Object
The prefixes used in render “foo” shortcuts.
57 58 59 |
# File 'lib/action_view/view_paths.rb', line 57 def _prefixes # :nodoc: self.class._prefixes end |
#append_view_path(path) ⇒ Object
Append a path to the list of view paths for the current LookupContext
.
Parameters
-
path
- If a String is provided, it gets converted into the default view path. You may also provide a custom view path (see ActionView::PathSet for more information)
79 80 81 |
# File 'lib/action_view/view_paths.rb', line 79 def append_view_path(path) lookup_context.view_paths.push(*path) end |
#details_for_lookup ⇒ Object
69 70 71 |
# File 'lib/action_view/view_paths.rb', line 69 def details_for_lookup {} end |
#lookup_context ⇒ Object
LookupContext
is the object responsible for holding all information required for looking up templates, i.e. view paths and details. Check ActionView::LookupContext
for more information.
64 65 66 67 |
# File 'lib/action_view/view_paths.rb', line 64 def lookup_context @_lookup_context ||= ActionView::LookupContext.new(self.class._view_paths, details_for_lookup, _prefixes) end |
#prepend_view_path(path) ⇒ Object
Prepend a path to the list of view paths for the current LookupContext
.
Parameters
-
path
- If a String is provided, it gets converted into the default view path. You may also provide a custom view path (see ActionView::PathSet for more information)
89 90 91 |
# File 'lib/action_view/view_paths.rb', line 89 def prepend_view_path(path) lookup_context.view_paths.unshift(*path) end |