Exception: Hanami::View::MissingTemplateError

Inherits:
Error
  • Object
show all
Defined in:
lib/hanami/view/errors.rb

Overview

Missing template error

This is raised at the runtime when Hanami::View cannot find a template for the requested format.

We can’t raise this error during the loading phase, because at that time we don’t know if a view implements its own rendering policy. A view is allowed to override ‘#render`, and this scenario can make the presence of a template useless. One typical example is the usage of a serializer that returns the output string, without rendering a template.

Since:

  • 0.1.0

Instance Method Summary collapse

Constructor Details

#initialize(template, format) ⇒ MissingTemplateError

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.

Returns a new instance of MissingTemplateError.

Since:

  • 0.1.0



22
23
24
# File 'lib/hanami/view/errors.rb', line 22

def initialize(template, format)
  super("Can't find template '#{ template }' for '#{ format }' format.")
end