instance method accepts

Ruby on Rails 2.3.18

Since v2.3.18 Last seen in v2.3.18

Signature

accepts()

Returns the accepted MIME type for the request.

Source
# File actionpack/lib/action_controller/request.rb, line 103
    def accepts
      @accepts ||= begin
        header = @env['HTTP_ACCEPT'].to_s.strip

        if header.empty?
          [content_type, Mime::ALL].compact
        else
          Mime::Type.parse(header)
        end
      end
    end

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

Defined in ActionController::Request

Type at least 2 characters to search.

↑↓ navigate · open · esc close