Is there anyway for me to return the id’s of the nested attributes when they are created?
right now i return the id of the parent this way. Where @report.id is the parent.
format.json { render :json => { :success => true, :report_id => @report.id } }
I would like to do something like this….
format.json { render :json => { :success => true, :report_id => @report.id, :the_ids_for_the_created_nested_attributes => @report.icons.ids } }
Credit to agmcleod and rails docs
Answer: Just put @report.icons in the response, then parse the json.