How can I chain multiple models to be rendered as a JSON object in rails. Currently I have a render statement like
render json: current_user.role.selected_bids.to_json(include: [:project => {include: [:milestones , :skill_category] } ] )
I want to append to this JSON object another model where I get to include a model associated to :milestones. Something like this
render json: current_user.role.selected_bids.to_json
(include: [:project => {include: [:milestones=> {include: [:timetrackers]},
:skill_category]}])
but its throwing a syntax error. Is it possible to do this level of nesting or should I make another API call ?