module Roda::RodaPlugins::RenderEach::InstanceMethods
def render_each(enum, template, opts=OPTS)
inside the template. An explicit +nil+ value does not
:local :: The local variable to use for the current enum value
Additional options supported:
given opts. The template and options hash are passed to +render+.
For each value in enum, render the given template using the
def render_each(enum, template, opts=OPTS) if as = opts.has_key?(:local) as = opts[:local] else as = template.to_s.to_sym end if as opts = opts.dup if locals = opts[:locals] locals = opts[:locals] = locals.dup else locals = opts[:locals] = {} end end enum.map do |v| locals[as] = v if as render_template(template, opts) end.join end