Class: Ezamar::RenderPartial
- Extended by:
- Ramaze::Helper::Partial
- Defined in:
- lib/ramaze/template/ezamar/render_partial.rb
Overview
Class Method Summary collapse
-
.transform(template) ⇒ Object
Renders <render src=“/path” [optional=“option”, …]> in place.
Methods included from Ramaze::Helper::Partial
render_action, render_partial, render_template
Class Method Details
.transform(template) ⇒ Object
Renders <render src=“/path” [optional=“option”, …]> in place.
Other options than ‘src` will be transformed to session parameters for the rendered action to use.
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/ramaze/template/ezamar/render_partial.rb', line 27 def self.transform(template) template.gsub!(/<render (.*?) \/>/) do |m| args = Hash[*$1.scan(/(\S+)=["'](.*?)["']/).flatten] if src = args.delete('src') render_partial(src, args) end end template end |