OSDN Git Service

list browser created
[pettanr/pettanr.git] / app / views / comics / top.html.erb
index c07326a..696809e 100644 (file)
@@ -1,3 +1,29 @@
-<h1>PettanR</h1>
+<h1><%= link_to '新着', comics_path %></h1>
+
+<table>
+  <tr>
+    <th>Title</th>
+    <th>editable</th>
+    <th>author_id</th>
+    <th>updated_at</th>
+    <th></th>
+  </tr>
+
+<% @comics.each do |comic| %>
+  <tr>
+    <td><%= link_to h(comic.title), :action => :play, :id => comic.id %></td>
+    <td><%= comic.editable %></td>
+    <td><%= comic.author_id%></td>
+    <td><%= comic.updated_at %></td>
+    <td>
+      <% if author_signed_in? -%>
+        <% if comic.own? current_author -%>
+          <%= link_to 'Destroy', comic, confirm: 'Are you sure?', method: :delete %>
+        <% end -%>
+      <% end -%>
+    </td>
+  </tr>
+<% end %>
+</table>
+<h1>人気</h1>
 
-