instance method content_type

Ruby on Rails 2.3.18

Since v2.3.18 Last seen in v2.3.18

Signature

content_type()

Returns the response’s content MIME type, or nil if content type has been set.

Source
# File actionpack/lib/action_controller/response.rb, line 77
    def content_type
      content_type = String(headers["Content-Type"] || headers["type"]).split(";")[0]
      content_type.blank? ? nil : content_type
    end

Defined in actionpack/lib/action_controller/response.rb line 77 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActionController::Response

Type at least 2 characters to search.

↑↓ navigate · open · esc close