2017-09-01 28 views
0
# routes.rb 
resources :resource 

# resources_controller.rb 
class ResourcesController < ApplicationController 
    # no methods here 
end 

# show.html.erb 
# file exists 

它呈現show.html.erb,爲什麼我沒有收到一個錯誤,指出ResourcesController#show不存在?在日誌中我看到的請求通過ResourcesController#show處理,即使該方法不存在。如果show方法不存在,爲什麼我不會收到錯誤?

我發現這種危險。

+0

如果您發現危險,請考慮添加到您的路線:'資源:東西,只:[:索引]'或任何你想要的路線。 – alexunger

回答

相關問題