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
Post a Comment