No route matches [GET] “/logout” [rails]
问题 I get the following routing error when I click on "logout": No route matches [GET] "/logout" This is my application.html.erb file: <% if session[:user_id] %> <%= link_to 'Logout', logout_path, :method => :delete %> <% end %> This is my routes.rb file: get 'admin' => 'admin#index' controller :sessions do get 'login' => :new post 'login'=> :create delete 'logout' => :destroy end get "sessions/create" get "sessions/destroy" Does anybody know how to solve this problem? 回答1: Have you enabled the