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

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -