Fred
Fred

Reputation: 1041

User /settings route?

Simple question:

I have added the following to my routes. rb

match 'settings' => 'users#edit'

I'm trying to make a user settings page at /settings (just with the edit form and the update button).

I have created the edit/update methods in my User controller, and added the edit view and _form.

For some reason when I go to /settings I am getting:

No route matches {:action=>"show", :controller=>"users"}

(Even though users#show exists)

Strangely, I can get it to work fine to route to users#show if I change my routes.rb - but that's not what I want!

I guess I'm missing something obvious - can someone point me in the right direction?

Upvotes: 0

Views: 94

Answers (2)

Fred
Fred

Reputation: 1041

Turns out commenting out my link_to fixed it..

Upvotes: 0

Matt Polito
Matt Polito

Reputation: 9756

Does this issue go away when you restart your dev server? Routes are funny when created after the server is running.

Upvotes: 1

Related Questions