質問編集履歴
3
タイトル
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
親のない、レコードの更新について
|
test
CHANGED
File without changes
|
2
コントローラの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -107,3 +107,41 @@
|
|
107
107
|
end
|
108
108
|
|
109
109
|
```
|
110
|
+
|
111
|
+
コントローラー
|
112
|
+
|
113
|
+
```ruby
|
114
|
+
|
115
|
+
def new
|
116
|
+
|
117
|
+
@words = Word.new
|
118
|
+
|
119
|
+
end
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
def create
|
124
|
+
|
125
|
+
word=words_params
|
126
|
+
|
127
|
+
word.each do |word|
|
128
|
+
|
129
|
+
@word = Word.create word
|
130
|
+
|
131
|
+
end
|
132
|
+
|
133
|
+
if @word.save
|
134
|
+
|
135
|
+
flash[:success] = "success!"
|
136
|
+
|
137
|
+
redirect_to @word
|
138
|
+
|
139
|
+
else
|
140
|
+
|
141
|
+
render 'new'
|
142
|
+
|
143
|
+
end
|
144
|
+
|
145
|
+
end
|
146
|
+
|
147
|
+
```
|
1
リンク
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#回答よろしくお願いします
|
2
2
|
|
3
|
-
[エラーのページ](https://gyazo.com/
|
3
|
+
[エラーのページ](https://gyazo.com/1fc90da0cb9f36a066062dd2e3bc0945)
|
4
4
|
|
5
5
|
```ruby
|
6
6
|
|