123456789_123456789_123456789_123456789_123456789_

Module: ActionView::Rendering

Relationships & Source Files
Namespace Children
Modules:
Extension / Inclusion / Inheritance Descendants
Included In:
::ActionController::Base, ::ActionMailer::Base, Layouts, TestCase::TestController, Rails::ApplicationController, Rails::InfoController, Rails::MailersController, Rails::WelcomeController
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
self, ViewPaths
Defined in: actionview/lib/action_view/rendering.rb

ViewPaths - Attributes & Methods

Class Method Summary

Instance Attribute Summary

Instance Method Summary

ViewPaths - Included

#append_view_path, #details_for_lookup,
#lookup_context

LookupContext is the object responsible to hold all information required to lookup templates, i.e. view paths and details.

#prepend_view_path, #template_exists?

Class Attribute Details

._view_paths (rw)

[ GitHub ]

  
# File 'actionview/lib/action_view/view_paths.rb', line 8

class_attribute :_view_paths

._view_paths?Boolean (rw)

[ GitHub ]

  
# File 'actionview/lib/action_view/view_paths.rb', line 8

class_attribute :_view_paths

Instance Attribute Details

#_view_paths (rw)

[ GitHub ]

  
# File 'actionview/lib/action_view/view_paths.rb', line 8

class_attribute :_view_paths

#_view_paths?Boolean (rw)

[ GitHub ]

  
# File 'actionview/lib/action_view/view_paths.rb', line 8

class_attribute :_view_paths

#view_context_class (rw)

[ GitHub ]

  
# File 'actionview/lib/action_view/rendering.rb', line 58

def view_context_class
  @_view_context_class ||= self.class.view_context_class
end

#view_context_class=(value) (rw)

[ GitHub ]

  
# File 'actionview/lib/action_view/rendering.rb', line 56

attr_internal_writer :view_context_class

Instance Method Details

#render_to_body(options = {})

[ GitHub ]

  
# File 'actionview/lib/action_view/rendering.rb', line 81

def render_to_body(options = {})
  _process_options(options)
  _render_template(options)
end

#rendered_format

[ GitHub ]

  
# File 'actionview/lib/action_view/rendering.rb', line 86

def rendered_format
  Mime[lookup_context.rendered_format]
end

#view_context

An instance of a view class. The default view class is Base

The view class must have the following methods: View.new[lookup_context, assigns, controller]

Create a new ActionView instance for a controller and we can also pass the arguments.

View#render(option)

Returns String with the rendered template

Override this method in a module to change the default behavior.

[ GitHub ]

  
# File 'actionview/lib/action_view/rendering.rb', line 71

def view_context
  view_context_class.new(view_renderer, view_assigns, self)
end

#view_renderer

Returns an object that is able to render templates. :api: private

[ GitHub ]

  
# File 'actionview/lib/action_view/rendering.rb', line 77

def view_renderer
  @_view_renderer ||= ActionView::Renderer.new(lookup_context)
end