Say i have this short code:
item = Item.find(params[:id]) render :json => item.to_json
but i needed to insert/push extra information to
I always use:
@item = Item.find(params[:id]) render json: { item: @item.map { |p| { id: p.id, name: p.name } }, message: "it works" }