summaryrefslogtreecommitdiff
path: root/app/views/alerts/index.html.erb
blob: 56954865f1deb6a202c2ac95d68df9c094b2465f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<h1>Listing alerts</h1>

<table>
  <thead>
    <tr>
      <th>Author</th>
      <th>Message</th>
      <th></th>
      <th></th>
      <th></th>
    </tr>
  </thead>

  <tbody>
    <% if !@alerts.nil? %>
      <% @alerts.each do |alert| %>
        <tr>
          <td><%= alert.author.user_name %></td>
          <td><%= alert.message %></td>
          <td><%= link_to 'Show', alert %></td>
          <td><%= link_to 'Edit', edit_alert_path(alert) %></td>
          <td><%= button_to 'Destroy', alert, method: :delete, data: { confirm: 'Are you sure?' } %></td>
        </tr>
      <% end %> 
    <% else %>
      <td><p>There are no alerts!</p></td>
    <% end %>
  </tbody>
</table>

<br>

<%= link_to 'New Alert', new_alert_path %>