Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

rails json exclude nested attribute

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}}}}}]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #rails #json #exclude #nested #attribute
ADD COMMENT
Topic
Name
3+5 =