Module: ActionView::Rendering

Extended by:
ActiveSupport::Concern
Includes:
ViewPaths
Included in:
Layouts
Defined in:
actionview/lib/action_view/rendering.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Methods included from ActiveSupport::Concern

append_features, extended, included

Methods included from ViewPaths

#_prefixes, #append_view_path, #details_for_lookup, #lookup_context, #prepend_view_path

Instance Method Details

#processObject

Overwrite process to setup I18n proxy.



28
29
30
31
32
33
# File 'actionview/lib/action_view/rendering.rb', line 28

def process(*) #:nodoc:
  old_config, I18n.config = I18n.config, I18nProxy.new(I18n.config, lookup_context)
  super
ensure
  I18n.config = old_config
end

#render_to_body(options = {}) ⇒ Object



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

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

#rendered_formatObject



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

def rendered_format
  Mime[lookup_context.rendered_format]
end

#view_contextObject

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

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

Create a new ActionView instance for a controller

View#render

Returns String with the rendered template

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



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

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

#view_context_classObject



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

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

#view_rendererObject

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



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

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