質問編集履歴

3

タイトル

2016/12/14 08:13

投稿

NishidaRyu416_
NishidaRyu416_

スコア113

test CHANGED
@@ -1 +1 @@
1
- Rails エラ発生
1
+ 親のない、レコドの更新について
test CHANGED
File without changes

2

コントローラの追加

2016/12/14 08:13

投稿

NishidaRyu416_
NishidaRyu416_

スコア113

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

リンク

2016/12/14 04:47

投稿

NishidaRyu416_
NishidaRyu416_

スコア113

test CHANGED
File without changes
test CHANGED
@@ -1,6 +1,6 @@
1
1
  #回答よろしくお願いします
2
2
 
3
- [エラーのページ](https://gyazo.com/2e9c3fe7e74ddb732a315510f1b920ca)
3
+ [エラーのページ](https://gyazo.com/1fc90da0cb9f36a066062dd2e3bc0945)
4
4
 
5
5
  ```ruby
6
6