edge badge

Basic rendering implements the most minimal rendering layer. It only supports rendering :text and :nothing. Passing any other option will result in `UnsupportedOperationError` exception. For more functionality like different formats, layouts etc. you should use `ActionView` gem.

Namespace
Methods
R
Instance Public methods
render(*args, &block)

Render text or nothing (empty string) to response_body :api: public

# File actionpack/lib/action_controller/metal/rendering.rb, line 11
def render(*args, &block)
  super(*args, &block)
  opts = args.first
  if opts.has_key?(:text) && opts[:text].present?
    self.response_body = opts[:text]
  elsif opts.has_key?(:nothing) && opts[:nothing]
    self.response_body = " "
  else
    raise UnsupportedOperationError
  end
end
rendered_format()
# File actionpack/lib/action_controller/metal/rendering.rb, line 23
def rendered_format
  Mime::TEXT
end