1:rails routesコマンドを実行し、ログアウトのpathを確認し、viewのlink_toの中にdestroy_user_session_pathと記述する。
Register as a new user and use Qiita more conveniently