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

Ruby on Rails - user_session_path error

I am building the RoR app and having trouble with locating the solution to this error. I have looked at the code files and it looks the same. I'm wondering if it is related to devise? or my routes file is missing a user session path. Can you please direct me? THANKS!

ERROR MESSAGE: undefined method `user_session_path' for #<ActionDispatch::Routing::RoutesProxy:0x000001028cbd58> Extracted source (around line #3):

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

1 Answer

Figured it out. It looks like I needed to change the route on my user session for an existing user post method.

FROM- post '/login' => 'devise/sessions#create', as: :new_user_session TO- post '/login' => 'devise/sessions#create', as: :user_session