Hello,
I am new to using the ROAR gem and am trying to get different output based on actions in my rails controller. For example:
The singular output for a show action should be
{"book_types": {"book_type_id": 1, "book_type": "hard_cover", "genre": "comedy"}}
The plural output for an index action should be
{"book_types": [{"book_type_id": 1, "book_type": "hard_cover", "genre": "comedy"},
{
"book_type_id": 1, "book_type": "hard_cover", "genre": "comedy"}]
}
What can I do to get the desired output?
Thanks