Uninitialized constant SessionController

I don’t understand why I am getting the error “uninitialized constant
SessionController” when I use the path login_path vs new_session_path
which works fine?

My routes is defined like this:

resource :session
get ‘/login’ => ‘session#new’, as: ‘login’
get ‘/logout’ => ‘session#destroy’, as: ‘logout’

 session POST   /session(.:format)           sessions#create

new_session GET /session/new(.:format) sessions#new
edit_session GET /session/edit(.:format) sessions#edit
GET /session(.:format) sessions#show
PATCH /session(.:format) sessions#update
PUT /session(.:format) sessions#update
DELETE /session(.:format) sessions#destroy
login GET /login(.:format) session#new
logout GET /logout(.:format) session#destroy

your pointing your route to ‘session’ not ‘sessions’. It should be get
‘/login’ => ‘sessions#new, as: :login

Matt

I missed that, it’s always something easy … Thanks!

On Sun, Apr 3, 2016 at 5:17 PM, BuyzLots [email protected] wrote:

My routes is defined like this:
PATCH /session(.:format) sessions#update
For more options, visit https://groups.google.com/d/optout.


You received this message because you are subscribed to the Google G. “Ruby
on Rails: Talk” group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected]
To post to this group, send email to [email protected]
To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/A59ACC12-242C-4B9C-B47B-172E9F1187F7%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Kind Regards,
Rajinder Y.

SafetyNet Test Driven Development
http://safetynet.devmentor.org

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs