質問編集履歴
1
change
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,59 +1,3 @@
|
|
1
|
-
![エラー内容](3d3a7bd6b0f515cb38a66582f2f1e8a6.png)
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
**users_controller.rb**
|
6
|
-
|
7
|
-
```ruby
|
8
|
-
|
9
|
-
class UsersController < ApplicationController
|
10
|
-
|
11
|
-
before_action :authenticate_user
|
12
|
-
|
13
|
-
def update
|
14
|
-
|
15
|
-
@user = user_params
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
if @user.save
|
20
|
-
|
21
|
-
flash[:notice] = "ユーザー情報を編集しました"
|
22
|
-
|
23
|
-
redirect_to("/users/#{@user.id}")
|
24
|
-
|
25
|
-
else
|
26
|
-
|
27
|
-
redirect_to edit_user_path(current_user), notice: "ユーザー情報を更新できませんでした"
|
28
|
-
|
29
|
-
end
|
30
|
-
|
31
|
-
end
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
private
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
def user_params
|
42
|
-
|
43
|
-
params.require(:user).permit(:avatar, :name, :email, :phone_number, :description, :college_name)
|
44
|
-
|
45
|
-
end
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
end
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
```
|
54
|
-
|
55
|
-
|
56
|
-
|
57
1
|
###やりたいこと
|
58
2
|
|
59
3
|
・ユーザーのプロフィール写真を表示させること
|