resources :buyers do
resources :invoices
end
= link_to ‘Show‘, buyer_invoice_path(@buyer, invoice)
= link_to ‘Edit‘, edit_buyer_invoice_path(@buyer, invoice)
= link_to ‘Destroy‘, [@buyer, invoice], :method => :delete, :data => { :confirm => ‘Are you sure?‘ }
= link_to ‘Back‘, buyer_invoices_path(@buyer, @invoice)
原文:https://www.cnblogs.com/znsongshu/p/9733865.html