开发者

Rails Sending the id in the wrong spot

I have a controller called prattachments which has a restful route inside of purchase_requests, but when I try to send a delete request by using this in an each_with_index block:

link_to "delete", purchase_request_prattachment_path(attachment), :method=>:delete

This route, according to rake routes should be:

purchase_request_prattachment 开发者_运维技巧DELETE /purchase_requests/:purchase_request_id/prattachments/:id {:action=>"destroy", :controller=>"prattachments"}

however, when it is called it reverses :purchase_request and :id, anybody know how to fix it?


call to path should be:

purchase_request_prattachment_path(purchase_request, attachment)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜