Rails: Include nested objects in json response -


i´m trying write json response include objects associations. object structure:

category   - sub_categories   - options      - city 

i going respond list of categories include sub_categories , options , city object each option. have now:

categories.as_json(:include => [:sub_categories, :options => :city]) 

which gives me "typeerror (can't clone symbol):" server error.

if try:

categories.as_json(:include => [:sub_categories, :options]) 

it works need include city-object each options well.

how can this?


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -