public Method

AbstractRequest.accepts

Returns the accepted MIME type for the request

Source Code

# File action_controller/request.rb, line 83
def accepts
  @accepts ||=
    if @env['HTTP_ACCEPT'].to_s.strip.empty?
      [ content_type, Mime::ALL ].compact # make sure content_type being nil is not included
    else
      Mime::Type.parse(@env['HTTP_ACCEPT'])
    end
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.