aboutsummaryrefslogtreecommitdiffstats
path: root/guides/code/getting_started/app/views/articles/index.html.erb
diff options
context:
space:
mode:
Diffstat (limited to 'guides/code/getting_started/app/views/articles/index.html.erb')
-rw-r--r--guides/code/getting_started/app/views/articles/index.html.erb21
1 files changed, 21 insertions, 0 deletions
diff --git a/guides/code/getting_started/app/views/articles/index.html.erb b/guides/code/getting_started/app/views/articles/index.html.erb
new file mode 100644
index 0000000000..80e9c8c60c
--- /dev/null
+++ b/guides/code/getting_started/app/views/articles/index.html.erb
@@ -0,0 +1,21 @@
+<h1>Listing Articles</h1>
+<table>
+ <tr>
+ <th>Title</th>
+ <th>Text</th>
+ <th></th>
+ <th></th>
+ <th></th>
+ </tr>
+
+<% @articles.each do |article| %>
+ <tr>
+ <td><%= article.title %></td>
+ <td><%= article.text %></td>
+ <td><%= link_to 'Show', action: :show, id: article.id %></td>
+ <td><%= link_to 'Edit', action: :edit, id: article.id %></td>
+ <td><%= link_to 'Destroy', { action: :destroy, id: article.id },
+ method: :delete, data: { confirm: 'Are you sure?' } %></td>
+ </tr>
+<% end %>
+</table>