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

Ruby

Andrew Merrick
Andrew Merrick
20,151 Points

LogIn Page for Treebook No Longer Works

After completing the "Creating the Friendship" video I now get the following error when I attempt to sign into my Treebook site:

treebook/app/views/devise/sessions/new.html.erb where line #4 raised:

undefined method `user_session_path' for #<ActionDispatch::Routing::RoutesProxy:0x00000100fdeea8>

4: <%= simple_form_for(resource, :as => resource_name, :url => session_path(resource_name), html: {class: "well"}) do |f| %>

I've checked the project files and mine match what's provided on the website, I've migrated my DB - I'm not sure where I'm supposed to look. I checked the routes.db as well and I can't find any errors.

Any suggestions? Every other part of the site works except for the login screen.

Andrew Merrick
Andrew Merrick
20,151 Points

SOLVED

The problem WAS in the routes.db!

I had

post "/login" => 'devise/sessions#create', as: :new_user_session

when it should be

post "/login" => 'devise/sessions#create', as: :user_session

All is well in treebook land!