From my Rails 3 app i want a JSON like this: {count:10, pictures:[ {id:1}, ... ] } I tried
render( :json => { :count => 10, :pictures => @pictures.to_json(:only=>:id) } )
but in this case, my pictures get escaped
..."pictures":"[{\"id\":2653299}, ....
In my old merb app i had the following simple line in my controller:
display( { :count=>@count, :pictures => @pictures } )
Because i am using datamapper
as my ORM and dm-serializer
i am not sure where to influence the generated json.