Module: ActionController::Rendering

Extended by:
ActiveSupport::Concern
Includes:
AbstractController::Rendering
Defined in:
actionpack/lib/action_controller/metal/rendering.rb

Instance Attribute Summary

Attributes included from AbstractController::Rendering

#view_context_class

Instance Method Summary (collapse)

Methods included from ActiveSupport::Concern

append_features, extended, included

Methods included from AbstractController::Rendering

#_prefixes, #_render_template, #initialize, #process, #render_to_body, #render_to_string, #view_context

Methods included from AbstractController::ViewPaths

#append_view_path, #details_for_lookup, #lookup_context, #prepend_view_path

Instance Method Details

- (Object) process_action

Before processing, set the request formats in current controller formats.



8
9
10
11
# File 'actionpack/lib/action_controller/metal/rendering.rb', line 8

def process_action(*) #:nodoc:
  self.formats = request.formats.map { |x| x.to_sym }
  super
end

- (Object) render(*args)

Check for double render errors and set the content_type after rendering.



14
15
16
17
18
19
# File 'actionpack/lib/action_controller/metal/rendering.rb', line 14

def render(*args) #:nodoc:
  raise ::AbstractController::DoubleRenderError if response_body
  super
  self.content_type ||= Mime[formats.first].to_s
  response_body
end