Module: Modular::Rendering::ClassMethods

Defined in:
lib/modular/rendering.rb

Instance Method Summary collapse

Instance Method Details

#view_context_classObject



63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/modular/rendering.rb', line 63

def view_context_class
  context = super
  
  context.send :define_method, :render_component do |component|
    component.render
  end
  
  context.send :include, Rails.application.routes.url_helpers if defined? Rails
  
  context.send :include, ApplicationHelper if defined? ApplicationHelper
  
  context
end