Module: Tagfiles::Tagfile
- Defined in:
- lib/tagfiles/tagfile.rb
Overview
Tagfile implementation
Instance Method Summary collapse
-
#tagfile(name, locals = {}, &block) ⇒ Object
(also: #tf)
Renders a
layout
when called with a block orpartial
otherwise.
Instance Method Details
#tagfile(name, locals = {}, &block) ⇒ Object Also known as: tf
Renders a layout
when called with a block or partial
otherwise.
Following partial lookups will be performed:
-
app/views/admin/page/tagfiles/_box.html.erb
-
app/views/admin/tagfiles/_box.html.erb
-
app/views/tagfiles/_box.html.erb
28 29 30 31 32 33 34 35 36 |
# File 'lib/tagfiles/tagfile.rb', line 28 def tagfile(name, locals = {}, &block) prefix = lookup_tagfile_prefix(controller.controller_path || "", name) if block render layout: "#{prefix}/#{name}", locals: locals, &block else render partial: "#{prefix}/#{name}", locals: locals end end |