質問編集履歴
2
追記させていただきました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -169,3 +169,91 @@
|
|
169
169
|
|
170
170
|
|
171
171
|
```
|
172
|
+
|
173
|
+
show.html
|
174
|
+
|
175
|
+
```
|
176
|
+
|
177
|
+
<div class="main posts-show">
|
178
|
+
|
179
|
+
<div class="container">
|
180
|
+
|
181
|
+
<div class="posts-show-item">
|
182
|
+
|
183
|
+
<p>
|
184
|
+
|
185
|
+
<%= link_to "<" ,"javascript:history.back()" %>
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
<%= @post.content%>
|
190
|
+
|
191
|
+
</p>
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
<div class="post-time">
|
196
|
+
|
197
|
+
<%= @post.created_at %>
|
198
|
+
|
199
|
+
</div>
|
200
|
+
|
201
|
+
<div class="post-menus">
|
202
|
+
|
203
|
+
<%=link_to"編集","/posts/#{@post.id}/edit"%>
|
204
|
+
|
205
|
+
<%=link_to"削除","/posts/#{@post.id}/destroy", {method:"post"}%>
|
206
|
+
|
207
|
+
</div>
|
208
|
+
|
209
|
+
</div>
|
210
|
+
|
211
|
+
</div>
|
212
|
+
|
213
|
+
</div>
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
```
|
218
|
+
|
219
|
+
edit.html
|
220
|
+
|
221
|
+
```<div class="main posts-new">
|
222
|
+
|
223
|
+
<div class="container">
|
224
|
+
|
225
|
+
<h1 class="form-heading">編集する</h1>
|
226
|
+
|
227
|
+
<%=form_tag("/posts/#{@post.id}/update") do %>
|
228
|
+
|
229
|
+
<div class="form">
|
230
|
+
|
231
|
+
<div class="form-body">
|
232
|
+
|
233
|
+
<% @post.errors.full_messages.each do |message| %>
|
234
|
+
|
235
|
+
<div class="form-error">
|
236
|
+
|
237
|
+
<%= message %>
|
238
|
+
|
239
|
+
</div>
|
240
|
+
|
241
|
+
<%end%>
|
242
|
+
|
243
|
+
<textarea name="content"><%= @post.content %></textarea>
|
244
|
+
|
245
|
+
<input type="submit" value="保存">
|
246
|
+
|
247
|
+
</div>
|
248
|
+
|
249
|
+
</div>
|
250
|
+
|
251
|
+
<% end %>
|
252
|
+
|
253
|
+
</div>
|
254
|
+
|
255
|
+
</div>
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
```
|
1
new.htmlを追記しました!
test
CHANGED
File without changes
|
test
CHANGED
@@ -121,3 +121,51 @@
|
|
121
121
|
```
|
122
122
|
|
123
123
|
調べても見当たらないのでよろしくお願いします。
|
124
|
+
|
125
|
+
追記
|
126
|
+
|
127
|
+
new.html
|
128
|
+
|
129
|
+
```
|
130
|
+
|
131
|
+
<div class="main posts-new">
|
132
|
+
|
133
|
+
<div class="container">
|
134
|
+
|
135
|
+
<h1 class="form-heading">投稿する</h1>
|
136
|
+
|
137
|
+
<%= form_tag("/posts/create") do %>
|
138
|
+
|
139
|
+
<div class="form">
|
140
|
+
|
141
|
+
<div class="form-body">
|
142
|
+
|
143
|
+
<% @post.errors.full_messages.each do |message| %>
|
144
|
+
|
145
|
+
<div class="form-error">
|
146
|
+
|
147
|
+
<%= message %>
|
148
|
+
|
149
|
+
</div>
|
150
|
+
|
151
|
+
<% end %>
|
152
|
+
|
153
|
+
<textarea name="@post.content"></textarea>
|
154
|
+
|
155
|
+
<input type="submit" value="投稿">
|
156
|
+
|
157
|
+
<%end%>
|
158
|
+
|
159
|
+
</div>
|
160
|
+
|
161
|
+
</div>
|
162
|
+
|
163
|
+
</div>
|
164
|
+
|
165
|
+
</div>
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
```
|