0

I have a nested resource as follows:

resources :loads do
  resources :stops
end

Here is how I am calling my show action for stops

def show
  @load = Load.find(params[:load_id])
  @stop = @load.stops.find(params[:id])
end

However I am getting an error message as follows.

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>}

What's causing this error and how can it be fixed?

4

0 回答 0