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

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -