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 5 years have passed since last update.

MethodErrorについて

Posted at

プログラミング初心者です。現在ユーザーログインページを開発中なのですが、form_tagめぞっどを使うと
NoMethodError in User#edit
Showing /home/ubuntu/workspace/app/views/user/edit.html.erb where line #2 raised:
undefined method `id' for nil:NilClass
Extracted source (around line #2):
1
2
3
4
5
6

編集フォームはこちら

<%= form_tag("/users/#{@user.id}/update") do %>

名前

メールアドレス

Rails.root: /home/ubuntu/workspace
Application Trace | Framework Trace | Full Trace
app/views/user/edit.html.erb:2:in `_app_views_user_edit_html_erb___220649719522465576_70041070436860'
Request
Parameters:
{"id"=>":id"}
Toggle session dump
Toggle env dump
Response
Headers:
None
とでてしまいます。controllerの入力も間違えがないはずなのですが、どなたか助言をいただけませんか?

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?