Module: ActionController::Rendering
- Extended by:
- ActiveSupport::Concern
- Included in:
- DataStreaming
- Defined in:
- lib/action_controller/metal/rendering.rb
Constant Summary collapse
- RENDER_FORMATS_IN_PRIORITY =
[:body, :text, :plain, :html]
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.
- #render_to_body(options = {}) ⇒ Object
-
#render_to_string ⇒ Object
Overwrite render_to_string because body can now be set to a rack body.
Instance Method Details
#process_action ⇒ Object
Before processing, set the request formats in current controller formats.
8 9 10 11 |
# File 'lib/action_controller/metal/rendering.rb', line 8 def process_action(*) #:nodoc: self.formats = request.formats.map(&:ref).compact super end |
#render(*args) ⇒ Object
Check for double render errors and set the content_type after rendering.
14 15 16 17 |
# File 'lib/action_controller/metal/rendering.rb', line 14 def render(*args) #:nodoc: raise ::AbstractController::DoubleRenderError if self.response_body super end |
#render_to_body(options = {}) ⇒ Object
31 32 33 |
# File 'lib/action_controller/metal/rendering.rb', line 31 def render_to_body( = {}) super || _render_in_priorities() || ' ' end |
#render_to_string ⇒ Object
Overwrite render_to_string because body can now be set to a rack body.
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/action_controller/metal/rendering.rb', line 20 def render_to_string(*) result = super if result.respond_to?(:each) string = "" result.each { |r| string << r } string else result end end |