Class: Lotus::View::Rendering::PartialFinder Private

Inherits:
TemplateFinder show all
Defined in:
lib/lotus/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 Lotus::View::Rendering::TemplateFinder

Instance Method Details

#findLotus::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 under the directory of the parent directory view template, if not found it will search recursivly from the view root.

Returns:

See Also:

Since:

  • 0.4.3



36
37
38
39
40
41
42
# File 'lib/lotus/view/rendering/partial_finder.rb', line 36

def find
  if path = partial_template_under_view_path
    View::Template.new path
  else
    super
  end
end