method
_normalize_options
v5.0.0.1 -
Show latest stable
- Class:
ActionController::Rendering
_normalize_options(options)private
Normalize both text and status options.
# File actionpack/lib/action_controller/metal/rendering.rb, line 83
def _normalize_options(options) #:nodoc:
_normalize_text(options)
if options[:text]
ActiveSupport::Deprecation.warn `render :text` is deprecated because it does not actually render a `text/plain` response. Switch to `render plain: 'plain text'` to render as `text/plain`, `render html: '<strong>HTML</strong>'` to render as `text/html`, or `render body: 'raw'` to match the deprecated behavior and render with the default Content-Type, which is `text/plain`..squish
end
if options[:html]
options[:html] = ERB::Util.html_escape(options[:html])
end
if options.delete(:nothing)
ActiveSupport::Deprecation.warn("`:nothing` option is deprecated and will be removed in Rails 5.1. Use `head` method to respond with empty response body.")
options[:body] = nil
end
if options[:status]
options[:status] = Rack::Utils.status_code(options[:status])
end
super
end