Skip to content
  • Jeremy Daer's avatar
    565094a8
    Use `Mime[:foo]` instead of `Mime::Type[:FOO]` for back compat · 565094a8
    Jeremy Daer authored
    Rails 4.x and earlier didn't support `Mime::Type[:FOO]`, so libraries
    that support multiple Rails versions would've had to feature-detect
    whether to use `Mime::Type[:FOO]` or `Mime::FOO`.
    
    `Mime[:foo]` has been around for ages to look up registered MIME types
    by symbol / extension, though, so libraries and plugins can safely
    switch to that without breaking backward- or forward-compatibility.
    
    Note: `Mime::ALL` isn't a real MIME type and isn't registered for lookup
    by type or extension, so it's not available as `Mime[:all]`. We use it
    internally as a wildcard for `respond_to` negotiation. If you use this
    internal constant, continue to reference it with `Mime::ALL`.
    
    Ref. efc6dd55
    565094a8
    Use `Mime[:foo]` instead of `Mime::Type[:FOO]` for back compat
    Jeremy Daer authored
    Rails 4.x and earlier didn't support `Mime::Type[:FOO]`, so libraries
    that support multiple Rails versions would've had to feature-detect
    whether to use `Mime::Type[:FOO]` or `Mime::FOO`.
    
    `Mime[:foo]` has been around for ages to look up registered MIME types
    by symbol / extension, though, so libraries and plugins can safely
    switch to that without breaking backward- or forward-compatibility.
    
    Note: `Mime::ALL` isn't a real MIME type and isn't registered for lookup
    by type or extension, so it's not available as `Mime[:all]`. We use it
    internally as a wildcard for `respond_to` negotiation. If you use this
    internal constant, continue to reference it with `Mime::ALL`.
    
    Ref. efc6dd55
Loading