Module: Padrino::Rendering::ClassMethods


Class methods responsible for rendering templates as part of a request.

Instance Method Summary

Instance Method Details

#cache_layout_path(name) ⇒ Object

#cache_template_path(options) ⇒ Object

#fetch_layout_path(given_layout, layouts_path = views) ⇒ Object

Returns the cached layout path.


  • given_layout (String, nil) — The requested layout.
  • layouts_path (String, nil) (defaults to: views) — The directory where the layouts are located. Defaults to #views.

#layout(name = :layout) { ... } ⇒ Object

Use layout like rails does or if a block given then like sinatra. If used without a block, sets the current layout for the route.

By default, searches in your:

app/views/layouts/application.(haml|erb|xxx) app/views/layout_name.(haml|erb|xxx)

If you define layout :custom then searches for your layouts in app/views/layouts/custom.(haml|erb|xxx) app/views/custom.(haml|erb|xxx)


  • name (Symbol) (defaults to: :layout) — (:layout) The layout to use.