module Roda::RodaPlugins::Partials::InstanceMethods
Public Instance Methods
Source
# File lib/roda/plugins/partials.rb, line 42 def each_partial(enum, template, opts=OPTS) unless opts.has_key?(:local) opts = Hash[opts] opts[:local] = render_each_default_local(template) end render_each(enum, partial_template_name(template.to_s), opts) end
For each object in the given enumerable, render the given template (prefixing the template filename with an underscore).
Source
# File lib/roda/plugins/partials.rb, line 53 def partial(template, opts=OPTS) opts = parse_template_opts(template, opts) if opts[:template] opts[:template] = partial_template_name(opts[:template]) end render_template(opts) end
Renders the given template without a layout, but prefixes the template filename to use with an underscore.
Private Instance Methods
Source
# File lib/roda/plugins/partials.rb, line 64 def partial_template_name(template) segments = template.split('/') segments[-1] = "_#{segments[-1]}" segments.join('/') end
Prefix the template base filename with an underscore.