Skip to content
  • Kasper Timm Hansen's avatar
    27c51396
    Use accept header instead of mangling request path. · 27c51396
    Kasper Timm Hansen authored
    Instead of appending a format to the request, it's much better
    to just pass a more appropriate accept header. Rails will figure
    out the format from that instead.
    
    This allows devs to use `:as` on routes that don't have a format.
    
    Introduce an `IdentityEncoder` to avoid `if request_encoder`,
    essentially a better version of the purpose of the `WWWFormEncoder`.
    One that makes conceptual sense on GET requests too.
    
    Fixes #27144.
    27c51396
    Use accept header instead of mangling request path.
    Kasper Timm Hansen authored
    Instead of appending a format to the request, it's much better
    to just pass a more appropriate accept header. Rails will figure
    out the format from that instead.
    
    This allows devs to use `:as` on routes that don't have a format.
    
    Introduce an `IdentityEncoder` to avoid `if request_encoder`,
    essentially a better version of the purpose of the `WWWFormEncoder`.
    One that makes conceptual sense on GET requests too.
    
    Fixes #27144.
Loading