Class/Module Index [+]

Quicksearch

AbstractController::Rendering

Attributes

view_context_class[W]

Public Class Methods

new(*) click to toggle source
# File lib/abstract_controller/rendering.rb, line 72
def initialize(*)
  @view_context_class = nil
  super
end

Public Instance Methods

_prefix() click to toggle source

The prefix used in render "foo" shortcuts.

# File lib/abstract_controller/rendering.rb, line 119
def _prefix
  controller_path
end
render(*args, &block) click to toggle source

Normalize arguments, options and then delegates render_to_body and sticks the result in self.response_body.

# File lib/abstract_controller/rendering.rb, line 92
def render(*args, &block)
  self.response_body = render_to_string(*args, &block)
end
render_to_body(options = {}) click to toggle source

Raw rendering of a template to a Rack-compatible body. :api: plugin

# File lib/abstract_controller/rendering.rb, line 107
def render_to_body(options = {})
  _process_options(options)
  _render_template(options)
end
render_to_string(*args, &block) click to toggle source

Raw rendering of a template to a string. Just convert the results of render_to_body into a String. :api: plugin

# File lib/abstract_controller/rendering.rb, line 99
def render_to_string(*args, &block)
  options = _normalize_args(*args, &block)
  _normalize_options(options)
  render_to_body(options)
end
view_context() click to toggle source

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.

# File lib/abstract_controller/rendering.rb, line 86
def view_context
  view_context_class.new(lookup_context, view_assigns, self)
end
view_context_class() click to toggle source
# File lib/abstract_controller/rendering.rb, line 68
def view_context_class
  @view_context_class || self.class.view_context_class
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.