質問編集履歴
4
コードの編集
test
CHANGED
File without changes
|
test
CHANGED
@@ -34,7 +34,7 @@
|
|
34
34
|
|
35
35
|
@kyusyupost.save
|
36
36
|
|
37
|
-
@kyusyuposts.all
|
37
|
+
@kyusyuposts=Kyusyuposts.all
|
38
38
|
|
39
39
|
redirect_to("/posts/kyusyu")
|
40
40
|
|
3
コードの編集
test
CHANGED
File without changes
|
test
CHANGED
@@ -33,6 +33,8 @@
|
|
33
33
|
@kyusyupost=Kyusyupost.new(content: params[:content])
|
34
34
|
|
35
35
|
@kyusyupost.save
|
36
|
+
|
37
|
+
@kyusyuposts.all
|
36
38
|
|
37
39
|
redirect_to("/posts/kyusyu")
|
38
40
|
|
2
development.logの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -83,3 +83,27 @@
|
|
83
83
|
</div>
|
84
84
|
|
85
85
|
```
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
投稿ボタンを押した時のdevelopment.log
|
90
|
+
|
91
|
+
```
|
92
|
+
|
93
|
+
Started GET "/posts/kyusyu" for 127.0.0.1 at 2020-07-26 05:00:53 +0000
|
94
|
+
|
95
|
+
Processing by PostsController#kyusyu as HTML
|
96
|
+
|
97
|
+
Rendering posts/kyusyu.html.erb within layouts/application
|
98
|
+
|
99
|
+
[1m[36mKyusyupost Load (0.3ms)[0m [1m[34mSELECT "kyusyuposts".* FROM "kyusyuposts"[0m
|
100
|
+
|
101
|
+
↳ app/views/posts/kyusyu.html.erb:14
|
102
|
+
|
103
|
+
Rendered posts/kyusyu.html.erb within layouts/application (Duration: 5.0ms | Allocations: 772)
|
104
|
+
|
105
|
+
[Webpacker] Everything's up-to-date. Nothing to do
|
106
|
+
|
107
|
+
Completed 200 OK in 13ms (Views: 11.3ms | ActiveRecord: 0.3ms | Allocations: 4208)
|
108
|
+
|
109
|
+
```
|
1
コードを分かりやすく表示した
test
CHANGED
File without changes
|
test
CHANGED
@@ -10,13 +10,17 @@
|
|
10
10
|
|
11
11
|
ルーティング
|
12
12
|
|
13
|
+
```
|
14
|
+
|
13
15
|
get 'posts/kyusyu' => "posts#kyusyu"
|
14
16
|
|
15
17
|
post "posts/kyusyucreate" => "posts#kyusyucreate"
|
16
18
|
|
17
|
-
|
19
|
+
```
|
18
20
|
|
19
21
|
コントローラー
|
22
|
+
|
23
|
+
```
|
20
24
|
|
21
25
|
def kyusyu
|
22
26
|
|
@@ -34,9 +38,11 @@
|
|
34
38
|
|
35
39
|
end
|
36
40
|
|
37
|
-
|
41
|
+
```
|
38
42
|
|
39
43
|
ビュー
|
44
|
+
|
45
|
+
```
|
40
46
|
|
41
47
|
<div class="uni-title">
|
42
48
|
|
@@ -75,3 +81,5 @@
|
|
75
81
|
<% end %>
|
76
82
|
|
77
83
|
</div>
|
84
|
+
|
85
|
+
```
|