質問編集履歴

3

誤字

2020/11/10 09:27

投稿

ken1203
ken1203

スコア24

test CHANGED
File without changes
test CHANGED
@@ -48,7 +48,45 @@
48
48
 
49
49
  ```Ruby
50
50
 
51
-
51
+ class PostsController < ApplicationController
52
+
53
+ before_action :set_post, only: [:show, :edit, :update, :destroy]
54
+
55
+
56
+
57
+ def index
58
+
59
+ @posts = Post.all
60
+
61
+ end
62
+
63
+
64
+
65
+ def show
66
+
67
+ end
68
+
69
+
70
+
71
+
72
+
73
+ def new
74
+
75
+ @post = Post.new
76
+
77
+ end
78
+
79
+
80
+
81
+
82
+
83
+ def edit
84
+
85
+ end
86
+
87
+
88
+
89
+
52
90
 
53
91
  def create
54
92
 
@@ -150,6 +188,8 @@
150
188
 
151
189
  end
152
190
 
191
+
192
+
153
193
  ```
154
194
 
155
195
 

2

誤字

2020/11/10 09:27

投稿

ken1203
ken1203

スコア24

test CHANGED
File without changes
test CHANGED
@@ -34,7 +34,7 @@
34
34
 
35
35
  21 def create
36
36
 
37
- 22 **@post = Post.new(post_params)**
37
+ 22 @post = Post.new(post_params)
38
38
 
39
39
  23   
40
40
 

1

誤字

2020/11/10 09:25

投稿

ken1203
ken1203

スコア24

test CHANGED
File without changes
test CHANGED
@@ -34,7 +34,7 @@
34
34
 
35
35
  21 def create
36
36
 
37
- 22 @post = Post.new(post_params)
37
+ 22 **@post = Post.new(post_params)**
38
38
 
39
39
  23   
40
40