# File lib/abstract_controller/rendering.rb, line 72 def initialize(*) @view_context_class = nil super end
The prefix used in render "foo" shortcuts.
# File lib/abstract_controller/rendering.rb, line 119 def _prefix controller_path end
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
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
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
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
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
# File lib/abstract_controller/rendering.rb, line 68 def view_context_class @view_context_class || self.class.view_context_class end