rails 3: include_root_in_json = true allows to have a root property for json response. But it doesn’t work with array of object, there is a property like include_root_in_array_json?
actually I have this response:
[ {"model": {"a":"a_value"}}, {"model": {"b":"b_value"}}]
but I want a response like that:
{"models":[ {"model": {"a":"a_value"}}, {"model": {"b":"b_value"}}]}
xml response has a root property ‘models’ which include the array, but json not…
You can try:
It’s not a very elegant solution but it does its job fine.