OSDN Git Service

t#30009:fix views
[pettanr/pettanr.git] / app / views / comics / index.html.erb
index 246b92e..0fdac37 100644 (file)
@@ -1,14 +1,14 @@
 <h1>Listing comics</h1>
 
-<% @comics.each do |comic| %>
-  <div>
-    <div>
-      <%= link_to h(comic.title), :controller => 'stories', :action => :comic, :id => comic.id %>
-    </div>
-    <div>
-      作家:<%= h comic.author.name %>
-      更新:<%= comic.updated_at %>
-    </div>
-  </div>
-<% end %>
+<table>
+  <tr>
+    <th>title</th>
+    <th>author</th>
+    <th>updated_at</th>
+    <th>edit</th>
+  </tr>
+  <% @comics.each do |comic| %>
+    <%= render 'list_item', :comic => comic, :author => @author %>
+  <% end %>
+</table>
 <%= link_to 'new comic', new_comic_path %>