我有一个嵌套资源,如下所示:
resources :loads do
resources :stops
end
以下是我如何调用我的停止动作
def show
@load = Load.find(params[:load_id])
@stop = @load.stops.find(params[:id])
end
但是我收到如下错误消息。
No route matches {:controller=>"stops", :action=>"show", :load_id=>#<Stop id: 62, load_id: 120, stop_type: "", stop_sequence: nil, stop_name: "", stop_address: "", stop_city: "", stop_state: "", stop_country: "", stop_postal: nil>}
导致此错误的原因是什么?如何修复?