質問編集履歴
2
一部見出しの変更
test
CHANGED
File without changes
|
test
CHANGED
@@ -194,11 +194,11 @@
|
|
194
194
|
|
195
195
|
|
196
196
|
|
197
|
-
###追加情報
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
197
|
+
###追加情報「index.html.erb」
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
```
|
202
202
|
|
203
203
|
<p id="notice"><%= notice %></p>
|
204
204
|
|
1
deleteを呼び出すviewである「index\.html\.erb」を追記しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -194,4 +194,74 @@
|
|
194
194
|
|
195
195
|
|
196
196
|
|
197
|
+
###追加情報
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
```index.html.erb
|
202
|
+
|
203
|
+
<p id="notice"><%= notice %></p>
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
<h1>Listing Comments</h1>
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
<table>
|
212
|
+
|
213
|
+
<thead>
|
214
|
+
|
215
|
+
<tr>
|
216
|
+
|
197
|
-
|
217
|
+
<th>User</th>
|
218
|
+
|
219
|
+
<th>Photo</th>
|
220
|
+
|
221
|
+
<th>Body</th>
|
222
|
+
|
223
|
+
<th colspan="3"></th>
|
224
|
+
|
225
|
+
</tr>
|
226
|
+
|
227
|
+
</thead>
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
<tbody>
|
232
|
+
|
233
|
+
<% @comments.each do |comment| %>
|
234
|
+
|
235
|
+
<tr>
|
236
|
+
|
237
|
+
<td><%= comment.user_id %></td>
|
238
|
+
|
239
|
+
<td><%= comment.photo_id %></td>
|
240
|
+
|
241
|
+
<td><%= comment.body %></td>
|
242
|
+
|
243
|
+
<td><%= link_to 'Show', comment %></td>
|
244
|
+
|
245
|
+
<td><%= link_to 'Edit', edit_comment_path(comment) %></td>
|
246
|
+
|
247
|
+
<td><%= link_to 'Destroy', comment, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
248
|
+
|
249
|
+
</tr>
|
250
|
+
|
251
|
+
<% end %>
|
252
|
+
|
253
|
+
</tbody>
|
254
|
+
|
255
|
+
</table>
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
<br>
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
<%= link_to 'New Comment', new_comment_path %>
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
```
|