質問編集履歴
1
articles_controller.rbに脱字があったので書き加えました
test
CHANGED
File without changes
|
test
CHANGED
@@ -60,6 +60,14 @@
|
|
60
60
|
|
61
61
|
|
62
62
|
|
63
|
+
def edit
|
64
|
+
|
65
|
+
@article = Article.find params[:id]
|
66
|
+
|
67
|
+
end
|
68
|
+
|
69
|
+
|
70
|
+
|
63
71
|
def create
|
64
72
|
|
65
73
|
#render plain: params[:article].inspect
|
@@ -84,8 +92,28 @@
|
|
84
92
|
|
85
93
|
end
|
86
94
|
|
95
|
+
|
96
|
+
|
97
|
+
def update
|
98
|
+
|
99
|
+
@article = Article.find params[:id]
|
100
|
+
|
101
|
+
if @article.update(article_params)
|
102
|
+
|
103
|
+
redirect_to @article
|
104
|
+
|
105
|
+
else
|
106
|
+
|
107
|
+
render 'edit'
|
108
|
+
|
109
|
+
end
|
110
|
+
|
111
|
+
end
|
112
|
+
|
87
113
|
|
88
114
|
|
115
|
+
|
116
|
+
|
89
117
|
|
90
118
|
|
91
119
|
def article_params
|