我正在尝试设置自定义路线。但是,每当我点击 Drink_locations/new 页面时,它都会尝试在 url 中发送“new”作为索引路径中的 :location_id。
路由.rb
controller 'beverage_locations' do
get 'beverage_locations/:location_id' => 'beverage_locations#index'
get 'beverage_locations/new' => 'beverage_locations#new'
end
错误
ActiveRecord::RecordNotFound in BeverageLocationsController#index
Couldn't find Location with id=new
知道如何解决这个问题吗?
谢谢!