Class: Hanami::View::Rendering::PartialFinder Private

Inherits:
TemplateFinder show all
Defined in:
lib/hanami/view/rendering/partial_finder.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Find a partial for the current view context. It’s used when a template wants to render a partial.

See Also:

Since:

  • 0.1.0

Constant Summary collapse

PREFIX =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Template file name prefix. By convention a partial file name starts with this prefix.

Examples:

"_sidebar.html.erb"

Since:

  • 0.1.0

'_'.freeze

Constants inherited from TemplatesFinder

TemplatesFinder::ENGINES, TemplatesFinder::FORMAT, TemplatesFinder::RECURSIVE

Instance Method Summary collapse

Methods inherited from TemplateFinder

#initialize

Methods inherited from TemplatesFinder

#initialize

Constructor Details

This class inherits a constructor from Hanami::View::Rendering::TemplateFinder

Instance Method Details

#findHanami::View::Template

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Find a template for a partial. Initially it will look for the partial template in the framework configuration where it may already be cached. Failing that it will look under the directory of the parent directory view template, if not found it will search recursively from the view root.

Returns:

See Also:

Since:

  • 0.4.3



37
38
39
40
# File 'lib/hanami/view/rendering/partial_finder.rb', line 37

def find
  Hanami::View::Configuration.for(@view).
    find_partial(relative_partial_path, template_name, format)
end