Module: AbstractController::Rendering::ClassMethods

Defined in:
lib/abstract_controller/rendering.rb

Instance Method Summary collapse

Instance Method Details

#view_context_classObject



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/abstract_controller/rendering.rb', line 47

def view_context_class
  @view_context_class ||= begin
    controller = self
    Class.new(ActionView::Base) do
      if controller.respond_to?(:_routes)
        include controller._routes.url_helpers
      end

      if controller.respond_to?(:_helpers)
        include controller._helpers

        # TODO: Fix RJS to not require this
        self.helpers = controller._helpers
      end
    end
  end
end