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
Post a Comment