Class: Erector::RbHandler

Inherits:
ActionView::TemplateHandler
  • Object
show all
Defined in:
lib/erector/rails2/template_handlers/rb_handler.rb

Instance Method Summary collapse

Instance Method Details

#render(template, local_assigns) ⇒ Object



42
43
44
45
46
47
48
# File 'lib/erector/rails2/template_handlers/rb_handler.rb', line 42

def render(template, local_assigns)
  require_dependency File.expand_path(template.filename)
  widget_class = "views/#{template.path_without_format_and_extension}".camelize.constantize
  is_partial = (File.basename(template.path_without_format_and_extension) =~ /^_/)
  assigns = Erector::Rails.assigns_for(widget_class, @view, local_assigns, is_partial)
  Erector::Rails.render(widget_class, @view, assigns)
end