質問編集履歴

5

code

2016/11/16 08:33

投稿

NishidaRyu416_
NishidaRyu416_

スコア113

test CHANGED
File without changes
test CHANGED
@@ -34,15 +34,21 @@
34
34
 
35
35
 
36
36
 
37
- def word_params
37
+ def word_params
38
+
39
+ params.require(:word).permit(:user_id, :title,:answer, :question,:image)
40
+
41
+ end
42
+
43
+
44
+
45
+ def words_params
38
46
 
39
47
  params.require(:word).map do |words|
40
48
 
41
49
  ActionController::Parameters.new(words.to_hash).permit(:question, :answer,:image,:title,:user_id)
42
50
 
43
51
  end
44
-
45
- #params.require(:word).permit(:user_id, :title,:answer, :question,:image)
46
52
 
47
53
  end
48
54
 

4

2016/11/16 08:33

投稿

NishidaRyu416_
NishidaRyu416_

スコア113

test CHANGED
File without changes
test CHANGED
@@ -54,6 +54,6 @@
54
54
 
55
55
  送信される。よって、そのようなケースに対応するStrongpramaterを、実装したい。
56
56
 
57
-
57
+ [こんな感じ](http://319ring.net/blog/archives/2591/)
58
58
 
59
59
  解決方法を教えてください。

3

2016/11/13 23:01

投稿

NishidaRyu416_
NishidaRyu416_

スコア113

test CHANGED
File without changes
test CHANGED
@@ -52,7 +52,7 @@
52
52
 
53
53
  具体的には、wordデータベースに、関連するフォームが複数あり、値が一度に複数
54
54
 
55
- 送信されるよって、そのようなケースに対応するStrongpramaterを、実装したい。
55
+ 送信されるよって、そのようなケースに対応するStrongpramaterを、実装したい。
56
56
 
57
57
 
58
58
 

2

2016/11/13 15:00

投稿

NishidaRyu416_
NishidaRyu416_

スコア113

test CHANGED
File without changes
test CHANGED
@@ -48,4 +48,12 @@
48
48
 
49
49
  ```
50
50
 
51
+ ##一度に複数のデータを、更新したい
52
+
53
+ 具体的には、wordデータベースに、関連するフォームが複数あり、値が一度に複数
54
+
55
+ 送信されるよって、そのようなケースに対応するStrongpramaterを、実装したい。
56
+
57
+
58
+
51
59
  解決方法を教えてください。

1

リンク修正

2016/11/13 14:59

投稿

NishidaRyu416_
NishidaRyu416_

スコア113

test CHANGED
File without changes
test CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
 
6
6
 
7
- https://gyazo.com/4bf2f138c96127b2ea3e6a152c19cbe9
7
+ [画像](https://gyazo.com/4bf2f138c96127b2ea3e6a152c19cbe9)
8
8
 
9
9
 
10
10