OSDN Git Service

replace codes
[pettanr/pettanr.git] / app / views / comics / index.html.erb
1 <h1>Listing comics</h1>
2
3 <table>
4   <tr>
5     <th>id</th>
6     <th>Title</th>
7     <th>Default width</th>
8     <th>Default height</th>
9     <th>author_id</th>
10     <th>updated_at</th>
11     <th></th>
12     <th></th>
13     <th></th>
14   </tr>
15
16 <% @comics.each do |comic| %>
17   <tr>
18     <td><%= comic.id %></td>
19     <td><%= h comic.title %></td>
20     <td><%= comic.width %></td>
21     <td><%= comic.height %></td>
22     <td><%= comic.author_id%></td>
23     <td><%= comic.updated_at %></td>
24     <td><%= link_to 'Show', comic %></td>
25     <td><%= link_to 'Play', :action => :play, :id => comic.id %></td>
26     <td>
27       <% if author_signed_in? -%>
28         <% if comic.own? current_author -%>
29           <%= link_to 'Destroy', comic, confirm: 'Are you sure?', method: :delete %>
30         <% end -%>
31       <% end -%>
32     </td>
33   </tr>
34 <% end %>
35 </table>
36