module ActionController::Rendering
Constants
- RENDER_FORMATS_IN_PRIORITY
Public Instance Methods
render_to_body(options = {})
click to toggle source
Calls superclass method
# File lib/action_controller/metal/rendering.rb, line 51 def render_to_body(options = {}) super || _render_in_priorities(options) || ' ' end
render_to_string(*)
click to toggle source
Overwrite #render_to_string because body can now be set to a rack body.
Calls superclass method
# 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
Private Instance Methods
_normalize_text(options)
click to toggle source
# File lib/action_controller/metal/rendering.rb, line 113 def _normalize_text(options) RENDER_FORMATS_IN_PRIORITY.each do |format| if options.key?(format) && options[format].respond_to?(:to_text) options[format] = options[format].to_text end end end
_render_in_priorities(options)
click to toggle source
# File lib/action_controller/metal/rendering.rb, line 57 def _render_in_priorities(options) RENDER_FORMATS_IN_PRIORITY.each do |format| return options[format] if options.key?(format) end nil end
_set_html_content_type()
click to toggle source
# File lib/action_controller/metal/rendering.rb, line 65 def _set_html_content_type self.content_type = Mime[:html].to_s end
_set_rendered_content_type(format)
click to toggle source
# File lib/action_controller/metal/rendering.rb, line 69 def _set_rendered_content_type(format) unless response.content_type self.content_type = format.to_s end end