to_json
Table of contents
Turns input into JSON, when possible. If input cannot be turned into JSON object, the filter just returns the input again.
When using to_json
on a hash, a multidimensional array is returned (see above). If you want to convert a hash to key/value JSON, you can pass true
as an argument. Plate Objects get converted to key/value JSON regardless of the passed argument.