Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial

Patrick Harrington
359 PointsCannot access /users/sign_up in "Generating the Devise Views"
Hi!
Having an issue following along with the tutorial video. After adding the form inputs into my New User view file, I started my Rails server back up and went to /users/sign_up, but it didn't work like in the video. Instead, I was booted back to my app's home screen and the yellow Devise bar at the top said "You are already signed in.".
Tried to navigate over to /users/sign_out (thinking this would fix it), but got a routing error saying:
No route matches [GET] "/users/sign_out"
Am I doing something wrong? Should I clear cookies before going to the next step? Was able to get around it by opening the app in another browser so that I could keep going.
Thanks!
4 Answers

Jim Hoskins
Treehouse Guest TeacherHi Patrick, it looks like things are working correctly, the problem is how the sign_out route works.
HTTP GET requests are for doing just that, getting information. A GET request shouldn't "change" anything. That's why most forms are POST forms, because POST is meant to change things.
Signing out "Changes" something, you change from being signed-in to signed-out. It's ill-advised to ever have a sign-out link accessible via GET. Because GET is supposed to be safe, some browsers could pre-fetch GET links for speed, but if it prefetched /sign-out, it would sign you out.
Because of that, the default sign_out path is an HTTP DELETE request. So by visiting /users/sign_out, you are GETing a path that is meant to be DELETEd. We end up creating a button that performs the correct action.
In the meantime you could clear your cookies, or go into private/incognito mode to sign yourself out.
Hope that helps

Kerel Lacy
8,474 PointsKeep watching the video and he should explain what do do next.
Since you are logged out the erb link "link_to currrent_user.full_name does not exist anymore"
Also try opening an incognito browser if you are using chrome.

Patrick Harrington
359 PointsHey Jim!
Love the work you and Jason are doing!
Yes, realize now why it makes sense that a GET request for /users/sign_out doesn't work by default. You explained that well in a later lesson. :)
My question was just about the continuity in the lesson "Generating the Devise Views" — I believe I was following the tutorial properly, but was unable to go to the user sign_in page (as instructed in the video) because I was signed in, and the part where we end up setting up the delete method for sessions didn't come until later.
Maybe it is because I may have checked "Remember Me" the first time I signed in? Just wanted to bring up an issue I had when following the videos that led me to need to open a new browser / incognito window.
Also, would love to see you guys do a set of Drupal videos some day—have tried to learn Rails before, and have never stuck with something the same way I am with your videos. Would love to see the same kind of tutorials for Drupal.
Thanks, Patrick

Jim Hoskins
Treehouse Guest TeacherI see. Manually testing authentication is tricky for exactly that reason. I'm not sure why in the video we may have been signed out, while you were still signed in. The remember me could have something to do with it, or we may have somehow cleared our cookies. It happens.
Typically when implementing, the order to do it in is "Register, sign-out, sign-in", because you obviously need to register first, but then you may be stuck "signed-in" until you can get sign-out working. Then its feasible to implement the sign-in form.
If you haven't implemented sign-out and you need to sign out, clearing cookies is the way to go.