Method: Cms::Behaviors::InstanceMethods#prepare_to_render

Defined in:
lib/cms/behaviors/rendering.rb

#prepare_to_render(controller) ⇒ Object



84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/cms/behaviors/rendering.rb', line 84

def prepare_to_render(controller)
  # Give this renderable a reference to the controller
  @controller = controller

  copy_instance_variables_from_controller!

  # This gives the view a reference to this object
  instance_variable_set(self.class.instance_variable_name_for_view, self)
    
  # This is like a controller action
  # We will call it if you have defined a render method
  # but if you haven't we won't
  render if respond_to?(:render)
end