Module: ActionController::Rendering
- Extended by:
- ActiveSupport::Concern
- Includes:
- AbstractController::Rendering, RackDelegation
- Included in:
- Streaming
- Defined in:
- lib/action_controller/metal/rendering.rb
Instance Attribute Summary
Attributes included from AbstractController::Rendering
Instance Method Summary collapse
-
#process_action ⇒ Object
Before processing, set the request formats in current controller formats.
-
#render(*args) ⇒ Object
Check for double render errors and set the content_type after rendering.
Methods included from AbstractController::Rendering
#_prefix, #_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
Methods included from RackDelegation
#dispatch, #reset_session, #response_body=
Instance Method Details
#process_action ⇒ Object
Before processing, set the request formats in current controller formats.
9 10 11 12 |
# File 'lib/action_controller/metal/rendering.rb', line 9 def process_action(*) #:nodoc: self.formats = request.formats.map { |x| x.ref } super end |
#render(*args) ⇒ Object
Check for double render errors and set the content_type after rendering.
15 16 17 18 19 20 |
# File 'lib/action_controller/metal/rendering.rb', line 15 def render(*args) #:nodoc: raise ::AbstractController::DoubleRenderError if response_body super self.content_type ||= Mime[formats.first].to_s response_body end |