質問編集履歴
4
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -46,6 +46,6 @@
|
|
46
46
|
|
47
47
|
```
|
48
48
|
|
49
|
-
という感じです
|
49
|
+
という感じです。
|
50
50
|
|
51
51
|
どうすれば解決できるでしょうか?
|
3
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -18,9 +18,17 @@
|
|
18
18
|
|
19
19
|
```ここに言語を入力
|
20
20
|
|
21
|
+
def newpost
|
22
|
+
|
23
|
+
@topic=Topic.new
|
24
|
+
|
25
|
+
@topicips=Topic.where(created_at:3.hours.ago..Time.now).pluck(:ip)#3時
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
|
30
|
+
|
21
31
|
def create
|
22
|
-
|
23
|
-
|
24
32
|
|
25
33
|
@topic = Topic.new(create_params)
|
26
34
|
|
2
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -10,6 +10,34 @@
|
|
10
10
|
|
11
11
|
undefined method `include?' for nil:NilClass
|
12
12
|
|
13
|
+
|
14
|
+
|
13
15
|
というエラーが出てしまいます。
|
14
16
|
|
17
|
+
コントローラーは
|
18
|
+
|
19
|
+
```ここに言語を入力
|
20
|
+
|
21
|
+
def create
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
@topic = Topic.new(create_params)
|
26
|
+
|
27
|
+
if @topic.save
|
28
|
+
|
29
|
+
redirect_to action: :topicposted
|
30
|
+
|
31
|
+
else
|
32
|
+
|
33
|
+
render 'newpost' #バリデーションエラーの場合レンダー
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
|
39
|
+
```
|
40
|
+
|
41
|
+
という感じです
|
42
|
+
|
15
43
|
どうすれば解決できるでしょうか?
|
1
追記
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|