Class: Smartgen::Renderer::ActionView
- Inherits:
-
Object
- Object
- Smartgen::Renderer::ActionView
- Defined in:
- lib/smartgen_action_view/renderer.rb
Overview
A renderer that uses ActionView to render markup files.
Defined Under Namespace
Modules: Helper
Instance Method Summary collapse
-
#render(layout, markup_file, metadata = Smartgen::ObjectHash.new) ⇒ Object
Renders the markup file using the given layout.
Instance Method Details
#render(layout, markup_file, metadata = Smartgen::ObjectHash.new) ⇒ Object
Renders the markup file using the given layout.
It exposes markup_file
variable and its metadata
to the ActionView layout.
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/smartgen_action_view/renderer.rb', line 26 def render(layout, markup_file, =Smartgen::ObjectHash.new) view = ::ActionView::Base.new(source_dir(markup_file)) view.extend(Helper) view.markup_file = markup_file view. = setup_content_for_with(view) view.render(:layout => layout, :text => markup_file.contents) end |