From my Rails 3 application, I want JSON like this: {Quantity: 10, pictures: [{ID: 1}, ...]} I tried
render( :json => { :count => 10, :pictures => @pictures.to_json(:only=>:id) } )
but in this case my pictures are screened
..."pictures":"[{\"id\":2653299}, ....
In my old merb application, I had the following simple line in my controller:
display( { :count=>@count, :pictures => @pictures } )
Since I use datamapperboth my ORM and dm-serializer, I'm not sure where to influence the generated json.
source
share