I introduced devise and implemented the user management function, but I encountered an unexpected error, so I will record it.
Routing Error No route matches [GET] "/users/sign_out"
<%= link_to 'Logout', destroy_user_session_path, method: :delete, class: :logout %>
Of course, it was also described in the view file as method:: delete
. For some reason, the HTTP method was locating for GET in the routing.
At the terminal 「control + c」 input. Run "rails s" in the terminal again
config/initializers/devise.rb/Line 269
config.sign_out_via = :delete
Change : delete
to: get
.
I still don't understand why this error occurred, even though the description is correct. Even if the description is exactly the same, an error may or may not occur.
Recommended Posts