Sha256: aaa9de3e3e619fd1048a42e84dce84913a71d385559a7ee49faafb76d3b77b74
Contents?: true
Size: 820 Bytes
Versions: 33
Compression:
Stored size: 820 Bytes
Contents
require 'innate/helper/render' module Nagoro module Pipe # Pipe that transforms <render /> tags. # # the src parameter in the render tag will be used as first parameter to # render_partial, all other paramters are passed on as +variables+. # # Example calling render_partial('hello'): # <render src="hello" /> # # Example calling render_partial('hello', 'tail' => 'foo'): # <render src="hello" tail="foo" /> # class RenderPartial < Base include Innate::Helper::Render def tag_start(tag, attrs) if tag == 'render' and action_name = attrs.delete('src') append(render_partial(action_name, attrs)) else super end end def tag_end(tag) super unless tag == 'render' end end end end
Version data entries
33 entries across 33 versions & 4 rubygems