Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 6 ActionController::UrlGenerationError: #91

Open
tee opened this issue Oct 11, 2018 · 0 comments
Open

Chapter 6 ActionController::UrlGenerationError: #91

tee opened this issue Oct 11, 2018 · 0 comments

Comments

@tee
Copy link

tee commented Oct 11, 2018

When running the test for the product, or in my case departure, I am getting this error:

Failure/Error: post "/users/#{user.id}/departures", params: { departure: @departure_attributes.merge(user_id: user.id, location_id: location.id) }, format: :json
ActionController::UrlGenerationError:
No route matches {:action=>"/users/1070/departures", :controller=>"api/v1/departures", :departure=>{:uuid=>"0e1641c2-3031-4079-8132-74499350a3b8", :user_id=>1070, :location_id=>492}, :format=>:json}

Even though I have this in my routes file.

resources :users, :only => [:show, :create, :update, :destroy] do
    resources :departures, :only => [:create]
end

Has anybody else experienced this issue? If so, how did you resolve it?

This is the route that appears in my terminal:

api_user_departures POST   /users/:user_id/departures(.:format)                                                     api/v1/departures#create {:subdomain=>"api", :format=>:json}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant