simple_datatables
simple_datatables copied to clipboard
Don't clobber the JSON MIME type.
simple_datatables
was preventing Rails from parsing POST messages with a JSON body. The reason was that Mime::Type.register
will associate a symbol with a mime type for both content generation (outbound HTTP responses, for instance) and content parsing (inbound HTTP requests), so when the middleware retrieved the identifying symbol associated with the application/json datatype, it got back :datatables, which it ignored. Mime::Type.register_alias
will associate the symbol with the mime type for content generation only, so parsing the JSON body into a parameters array still works.