module Roda::RodaPlugins::Partials::InstanceMethods

  1. lib/roda/plugins/partials.rb

Methods

Public Instance

  1. each_partial
  2. partial

Public Instance methods

each_partial(enum, template, opts=OPTS)

For each object in the given enumerable, render the given template (prefixing the template filename with an underscore).

[show source]
   # File lib/roda/plugins/partials.rb
42 def each_partial(enum, template, opts=OPTS)
43   unless opts.has_key?(:local)
44     opts = Hash[opts]
45     opts[:local] = render_each_default_local(template)
46   end
47   render_each(enum, partial_template_name(template.to_s), opts)
48 end
partial(template, opts=OPTS)

Renders the given template without a layout, but prefixes the template filename to use with an underscore.

[show source]
   # File lib/roda/plugins/partials.rb
53 def partial(template, opts=OPTS)
54   opts = parse_template_opts(template, opts)
55   if opts[:template]
56     opts[:template] = partial_template_name(opts[:template])
57   end
58   render_template(opts)
59 end