Module: Hanami::View::Rendering
- Defined in:
- lib/hanami/view/rendering.rb,
lib/hanami/view/rendering/scope.rb,
lib/hanami/view/rendering/options.rb,
lib/hanami/view/rendering/partial.rb,
lib/hanami/view/rendering/registry.rb,
lib/hanami/view/rendering/subscope.rb,
lib/hanami/view/rendering/template.rb,
lib/hanami/view/rendering/null_view.rb,
lib/hanami/view/rendering/null_local.rb,
lib/hanami/view/rendering/null_layout.rb,
lib/hanami/view/rendering/view_finder.rb,
lib/hanami/view/rendering/layout_scope.rb,
lib/hanami/view/rendering/partial_file.rb,
lib/hanami/view/rendering/layout_finder.rb,
lib/hanami/view/rendering/null_template.rb,
lib/hanami/view/rendering/template_name.rb,
lib/hanami/view/rendering/partial_finder.rb,
lib/hanami/view/rendering/layout_registry.rb,
lib/hanami/view/rendering/template_finder.rb,
lib/hanami/view/rendering/templates_finder.rb,
lib/hanami/view/rendering/partial_templates_finder.rb
Overview
Rendering methods
Defined Under Namespace
Modules: InstanceMethods Classes: LayoutFinder, LayoutRegistry, LayoutScope, NullLayout, NullLocal, NullTemplate, NullView, Options, Partial, PartialFile, PartialFinder, PartialTemplatesFinder, Registry, Scope, Subscope, Template, TemplateFinder, TemplateName, TemplatesFinder, ViewFinder
Constant Summary collapse
- KNOWN_RENDER_TYPES =
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.
List of render types that exactly one of must be included when calling ‘#render`. For example, when calling `<%= render something: ’my_thing’, locals: {} %>‘, ’something’ must be one of the values listed here.
[:partial, :template].freeze
Class Method Summary collapse
- .extended(base) ⇒ Object private
Instance Method Summary collapse
-
#render(context) ⇒ String
Render the given context and locals with the appropriate template.
Class Method Details
.extended(base) ⇒ Object
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.
16 17 18 19 20 |
# File 'lib/hanami/view/rendering.rb', line 16 def self.extended(base) base.class_eval do include InstanceMethods end end |
Instance Method Details
#render(context) ⇒ String
Render the given context and locals with the appropriate template. If there are registered subclasses, it choose the right class, according
to the requested format.
258 259 260 |
# File 'lib/hanami/view/rendering.rb', line 258 def render(context) registry.resolve(context).render end |