質問編集履歴
2
誤字の修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -17,7 +17,7 @@
|
|
17
17
|
|
18
18
|
def create
|
19
19
|
@album = current_user.albums.find_by(params[:id])
|
20
|
-
@picture = @album.
|
20
|
+
@picture = @album.pictures.build(picture_params)
|
21
21
|
if @picture.save
|
22
22
|
flash[:success] = "写真を追加しました!"
|
23
23
|
redirect_to @album
|
1
誤字の修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -17,8 +17,8 @@
|
|
17
17
|
|
18
18
|
def create
|
19
19
|
@album = current_user.albums.find_by(params[:id])
|
20
|
-
@
|
20
|
+
@picture = @album.posts.build(picture_params)
|
21
|
-
if @
|
21
|
+
if @picture.save
|
22
22
|
flash[:success] = "写真を追加しました!"
|
23
23
|
redirect_to @album
|
24
24
|
else
|
@@ -28,8 +28,8 @@
|
|
28
28
|
|
29
29
|
private
|
30
30
|
|
31
|
-
def
|
31
|
+
def picture_params
|
32
|
-
params.fetch(:
|
32
|
+
params.fetch(:picture, {}).permit(:picture)
|
33
33
|
end
|
34
34
|
|
35
35
|
end
|