OSDN Git Service

added views add to field
[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>width</th>
8     <th>height</th>
9     <th>visible</th>
10     <th>editable</th>
11     <th>author_id</th>
12     <th>updated_at</th>
13     <th></th>
14     <th></th>
15     <th></th>
16   </tr>
17
18 <% @comics.each do |comic| %>
19   <tr>
20     <td><%= comic.id %></td>
21     <td><%= h comic.title %></td>
22     <td><%= comic.width %></td>
23     <td><%= comic.height %></td>
24     <td><%= comic.visible %></td>
25     <td><%= comic.editable %></td>
26     <td><%= comic.author_id%></td>
27     <td><%= comic.updated_at %></td>
28     <td><%= link_to 'Show', comic %></td>
29     <td><%= link_to 'Play', :action => :play, :id => comic.id %></td>
30     <td>
31       <% if author_signed_in? -%>
32         <% if comic.own? current_author -%>
33           <%= link_to 'Destroy', comic, confirm: 'Are you sure?', method: :delete %>
34         <% end -%>
35       <% end -%>
36     </td>
37   </tr>
38 <% end %>
39 </table>
40