【发布时间】:2014-09-24 07:33:00
【问题描述】:
在我的控制器中,我有 -
def remove_file
@chap_comment.remove_chap_comment_pdf!
@chap_comment.save
end
...在我看来,我有 -
<%= link_to 'remove pdf', controller: 'chap_comments', action: 'remove_file', id: comment.id %>
...在 routes.rb 我只是有 -
资源:chap_cmets
...但是在带有链接的页面甚至呈现之前我得到No route matches {:action=>"remove_file", :controller=>"chap_comments", :id=>1} - 我应该在我的路线中放什么?
【问题讨论】:
标签: ruby-on-rails ruby-on-rails-4 routes