Let\'s say I have an app that handles a TODO list. The list has finished and unfinished items. Now I want to add two virtual attributes to the list object; the count of fini
This will do, without having to do some ugly overridings. If you got a model List for example, you can put this in your controller:
List
render json: list.attributes.merge({ finished_items: list.finished_items, unfinished_items: list.unfinished_items })