Class: Ruhl::Plugin
- Inherits:
-
ActionView::TemplateHandler
- Object
- ActionView::TemplateHandler
- Ruhl::Plugin
- Defined in:
- lib/ruhl/rails.rb
Instance Method Summary collapse
-
#initialize(action_view) ⇒ Plugin
constructor
A new instance of Plugin.
- #render(template, options = {}) ⇒ Object
Constructor Details
#initialize(action_view) ⇒ Plugin
Returns a new instance of Plugin.
7 8 9 |
# File 'lib/ruhl/rails.rb', line 7 def initialize(action_view) @action_view = action_view end |
Instance Method Details
#render(template, options = {}) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/ruhl/rails.rb', line 11 def render(template, = {}) layout = [:layout] if layout layout_template = @action_view.controller.send(:find_layout, layout, @action_view.controller.send(:default_template_format) ) else unless layout == false layout_template = @action_view.controller.active_layout end end if layout_template [:layout] = layout_template.filename [:layout_source] = layout_template.source end Ruhl::Engine.new(template.source, ).render(@action_view) end |