Module: ActionController::Rendering
- Extended by:
- ActiveSupport::Concern
- Included in:
- DataStreaming
- Defined in:
- lib/action_controller/metal/rendering.rb
Defined Under Namespace
Modules: ClassMethods
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.
28 29 30 31 |
# File 'lib/action_controller/metal/rendering.rb', line 28 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.
34 35 36 37 |
# File 'lib/action_controller/metal/rendering.rb', line 34 def render(*args) #:nodoc: raise ::AbstractController::DoubleRenderError if self.response_body super end |
#render_to_body(options = {}) ⇒ Object
51 52 53 |
# File 'lib/action_controller/metal/rendering.rb', line 51 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.
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/action_controller/metal/rendering.rb', line 40 def render_to_string(*) result = super if result.respond_to?(:each) string = "" result.each { |r| string << r } string else result end end |