Sha256: 962f516eb97659205cde188b108aeb1fc51010a4262892c331372816346b4735

Contents?: true

Size: 580 Bytes

Versions: 3

Compression:

Stored size: 580 Bytes

Contents

ActionController::Base.class_eval do
  def render_widget(widget_class, assigns=@assigns)
    @__widget_class = widget_class
    @__widget_assigns = assigns
    add_variables_to_assigns
    render :inline => "<% @__widget_class.new(self, @__widget_assigns, _erbout).render %>"
  end

  def render_with_erector_widget(*options, &block)
    if options.first.is_a?(Hash) && widget = options.first.delete(:widget)
      render_widget widget, @assigns, &block
    else
      render_without_erector_widget *options, &block
    end
  end
  alias_method_chain :render, :erector_widget
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
pivotal-erector-0.5.1 lib/erector/rails/extensions/action_controller/1.2.5/action_controller.rb
erector-0.5.1 lib/erector/rails/extensions/action_controller/1.2.5/action_controller.rb
erector-0.5.0 lib/erector/rails/extensions/action_controller/1.2.5/action_controller.rb