在我看來,我有 -導軌 - 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 %>
...得到了同樣的錯誤。