📜  rails json 排除嵌套属性 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:19.588000             🧑  作者: Mango

代码示例1
render :json => @booking, :include => [:paypal, 
                                       :boat_people,
                                       :boat => {:only => :name, :include => {:port => {:only => :name, :include => {:city => {:only => :name, :include => {:country => {:only => :name}}}}}, 
                                                :boat_model => {:only => :name, :include => {:boat_type => {:only => :name}}}}}]