0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

エラー:No route matches [GET] "/new_user_session_path"

Posted at

##環境
MacOS BigSur Ver11.5.2
Ruby 3.0.2
Rails 6.1.4.1

##状況
Railsアプリを実装中、下記のエラー発生

No route matches [GET] "/new_user_session_path"

一見問題なさそう

app/views/layouts/_header.html.slim
li
  = link_to 'ログイン', 'new_user_session_path'

pathを確認したけど間違ってない

$ rails routes
...
new_user_password_path	GET	/users/password/new(.:format)	devise/passwords#new
...

##解決方法
#####原因:pathを””で囲っていた…
初歩的なミスすぎて自分で自分に引きました

app/views/layouts/_header.html.slim
li
  = link_to 'ログイン', new_user_session_path

##参考
https://railsdoc.com/page/link_to

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?