邮件文件
button_to 'YES', lender_accept_url(borrow), method: :post, id: "accept #{borrow.id}", style: "background-color:green; color: white; width: 40px; display: inline"
button_to 'NO', lender_decline_url(borrow), method: :post, id: "decline #{borrow.id}", style: "background-color:gray; width: 40px; display: inline"
路线
post 'inventories/:id/accept', to: 'inventories#accept', as: 'lender_accept'
post 'inventories/:id/decline', to: 'inventories#decline', as: 'lender_decline'
但是,当我单击电子邮件中的一个按钮时,它需要我http://example.com/inventories/:id/decline
为什么 URL 助手没有指向我自己的域?请注意,Mailer 文件中使用的相同部分也用于常规视图页面,并且在该页面上,路由工作正常。