ruby on rails - Parent-Child form -


how show parent-child relationship on single page in rails? don't need form want show information (no edits or updates required). parent customer , child orders. want able select customer, display customer information such address, , list orders placed in row format. thanks.

assuming have model associations set properly..

in controller,

@customer = customer.find(params[:id]) @orders = @customer.orders.all 

then in view, use orders variable.


Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

jquery - How would i go about shortening this code? And to cancel the previous click on click of new section? -