質問編集履歴
4
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -8,7 +8,9 @@
|
|
8
8
|
|
9
9
|
テンプレがないとしてエラーが起きてしまう。
|
10
10
|
|
11
|
-
構文エラーは発生してな
|
11
|
+
構文エラーは発生してなく、
|
12
|
+
|
13
|
+
空のインスタンスも作成しています。
|
12
14
|
|
13
15
|
|
14
16
|
|
3
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -84,7 +84,7 @@
|
|
84
84
|
|
85
85
|
```
|
86
86
|
|
87
|
-
一応routesも記載です
|
87
|
+
一応routes, controllerも記載です
|
88
88
|
|
89
89
|
```ruby
|
90
90
|
|
@@ -104,4 +104,22 @@
|
|
104
104
|
|
105
105
|
|
106
106
|
|
107
|
+
```rb
|
108
|
+
|
109
|
+
class PostsController < ApplicationController
|
110
|
+
|
111
|
+
...
|
112
|
+
|
113
|
+
def new
|
114
|
+
|
115
|
+
@post = Post.new
|
116
|
+
|
117
|
+
end
|
118
|
+
|
119
|
+
...
|
120
|
+
|
121
|
+
```
|
122
|
+
|
123
|
+
|
124
|
+
|
107
125
|
ご教授お願いします
|
2
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -82,9 +82,7 @@
|
|
82
82
|
|
83
83
|
<% end %>
|
84
84
|
|
85
|
-
|
86
|
-
|
87
|
-
|
85
|
+
```
|
88
86
|
|
89
87
|
一応routesも記載です
|
90
88
|
|
1
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -48,6 +48,44 @@
|
|
48
48
|
|
49
49
|
---
|
50
50
|
|
51
|
+
元のソース
|
52
|
+
|
53
|
+
```erb
|
54
|
+
|
55
|
+
(new.html.erb)
|
56
|
+
|
57
|
+
<h2>Add New Post</h2>
|
58
|
+
|
59
|
+
<%= form_for :post, url: posts_path do |f| %>
|
60
|
+
|
61
|
+
<p>
|
62
|
+
|
63
|
+
<%= f.text_field :title, placeholder:'enter title' %>
|
64
|
+
|
65
|
+
<% end %>
|
66
|
+
|
67
|
+
</p>
|
68
|
+
|
69
|
+
<p>
|
70
|
+
|
71
|
+
<%= f.text_area :body, placeholder:'enter body text' %>
|
72
|
+
|
73
|
+
<% end %>
|
74
|
+
|
75
|
+
</p>
|
76
|
+
|
77
|
+
<p>
|
78
|
+
|
79
|
+
<%= f.submit %>
|
80
|
+
|
81
|
+
</p>
|
82
|
+
|
83
|
+
<% end %>
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
---
|
88
|
+
|
51
89
|
一応routesも記載です
|
52
90
|
|
53
91
|
```ruby
|