class Erector::RbHandler

Public Instance Methods

render(template, local_assigns) click to toggle source
# 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) =~ %r^_/)
  assigns = Erector::Rails.assigns_for(widget_class, @view, local_assigns, is_partial)
  Erector::Rails.render(widget_class, @view, assigns)
end