在我看来,我有 -导轨 - nilclass在控制器动作
<%= link_to 'remove pdf', controller: 'chap_comments', action: 'remove_file', id: comment.id %>
在我的控制器我有 - !
def remove_file
@chap_comment.remove_chap_comment_pdf!
@chap_comment.save
end
...我越来越undefined method
remove_chap_comment_pdf”为零:NilClass` - 为什么班级不被识别?
同样,以下 -
<%= link_to 'remove pdf', remove_file_chap_comment_path(:id), method: :delete %>
...得到了同样的错误。