Module: ActionView::ViewPaths
Relationships & Source Files | |
Namespace Children | |
Modules:
| |
Extension / Inclusion / Inheritance Descendants | |
Included In:
::AbstractController::Rendering ,
::ActionController::API ,
::ActionController::Base ,
::ActionMailer::Base ,
Layouts ,
LookupContext ,
Rendering ,
TestCase::TestController ,
Rails::ApplicationController,
::Rails::HealthController ,
Rails::InfoController,
Rails::MailersController,
Rails::WelcomeController
| |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
::ActiveSupport::Concern
|
|
Defined in: | actionview/lib/action_view/view_paths.rb |
Class Method Summary
::ActiveSupport::Concern
- Extended
class_methods | Define class methods from given block. |
included | Evaluate given block in context of base class, so that you can write class macros here. |
prepended | Evaluate given block in context of base class, so that you can write class macros here. |
Instance Attribute Summary
- #formats rw
- #locale rw
- #view_paths readonly
Instance Method Summary
- #any_templates? ⇒ Boolean
-
#append_view_path(path)
Append a path to the list of view paths for the current
LookupContext
. - #details_for_lookup
-
#lookup_context
LookupContext
is the object responsible for holding all information required for looking up templates, i.e. view paths and details. -
#prepend_view_path(path)
Prepend a path to the list of view paths for the current
LookupContext
. - #template_exists? ⇒ Boolean
DSL Calls
included
[ GitHub ]7 8 9
# File 'actionview/lib/action_view/view_paths.rb', line 7
included do ActionView::PathRegistry.set_view_paths(self, ActionView::PathSet.new.freeze) end
Instance Attribute Details
#formats (rw)
[ GitHub ]# File 'actionview/lib/action_view/view_paths.rb', line 11
delegate :template_exists?, :any_templates?, :view_paths, :formats, :formats=, :locale, :locale=, to: :lookup_context
#locale (rw)
[ GitHub ]# File 'actionview/lib/action_view/view_paths.rb', line 11
delegate :template_exists?, :any_templates?, :view_paths, :formats, :formats=, :locale, :locale=, to: :lookup_context
#view_paths (readonly)
[ GitHub ]# File 'actionview/lib/action_view/view_paths.rb', line 11
delegate :template_exists?, :any_templates?, :view_paths, :formats, :formats=, :locale, :locale=, to: :lookup_context
Instance Method Details
#any_templates? ⇒ Boolean
# File 'actionview/lib/action_view/view_paths.rb', line 11
delegate :template_exists?, :any_templates?, :view_paths, :formats, :formats=, :locale, :locale=, to: :lookup_context
#append_view_path(path)
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)
# File 'actionview/lib/action_view/view_paths.rb', line 103
def append_view_path(path) lookup_context.append_view_paths(self.class._build_view_paths(path)) end
#details_for_lookup
[ GitHub ]# File 'actionview/lib/action_view/view_paths.rb', line 93
def details_for_lookup {} end
#lookup_context
LookupContext
is the object responsible for holding all information required for looking up templates, i.e. view paths and details. Check LookupContext
for more information.
# File 'actionview/lib/action_view/view_paths.rb', line 88
def lookup_context @_lookup_context ||= ActionView::LookupContext.new(self.class._view_paths, details_for_lookup, _prefixes) end
#prepend_view_path(path)
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)
# File 'actionview/lib/action_view/view_paths.rb', line 113
def prepend_view_path(path) lookup_context.prepend_view_paths(self.class._build_view_paths(path)) end
#template_exists? ⇒ Boolean
# File 'actionview/lib/action_view/view_paths.rb', line 11
delegate :template_exists?, :any_templates?, :view_paths, :formats, :formats=, :locale, :locale=, to: :lookup_context