1
votes

I am doing Michael Hartl's Ruby on Rails Tutorial and I am getting a routing error.
Here is the terminal output after doing rake routes:

      users GET    /users(.:format)          users#index
            POST   /users(.:format)          users#create
   new_user GET    /users/new(.:format)      users#new
  edit_user GET    /users/:id/edit(.:format) users#edit
       user GET    /users/:id(.:format)      users#show
            PUT    /users/:id(.:format)      users#update
            DELETE /users/:id(.:format)      users#destroy
   sessions POST   /sessions(.:format)       sessions#create
new_session GET    /sessions/new(.:format)   sessions#new
    session DELETE /sessions/:id(.:format)   sessions#destroy
       root        /                         static_pages#home
     signup        /signup(.:format)         users#new
     signin        /signin(.:format)         sessions#new
    signout DELETE /signout(.:format)        sessions#destroy
       help        /help(.:format)           static_pages#help
      about        /about(.:format)          static_pages#about
    contact        /contact(.:format)        static_pages#contact

Routing error is as below
when localhost:3000/signin/ OR localhost:3000/sessions/new

No route matches {:action=>"destroy", :controller=>"sessions"}

Does anybody have an answer on how to correct the route settings?

1
i did the tutorial myself and it was fine. in which chapter you are and how does the config/routes.rb file looks like?SeriousM
thanks fou your replay. I'm doing chap.8sean
What about sessions_controller?claptimes
and the (again) config/routes.rb file please.SeriousM
please show us your routes and the relevant controller/viewHuy

1 Answers

0
votes

Do you have a line like this in your routes file?

match '/signout', :to => 'sessions#destroy'