summaryrefslogtreecommitdiff
path: root/app/views/alerts/index.html.erb
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/alerts/index.html.erb')
-rw-r--r--app/views/alerts/index.html.erb20
1 files changed, 12 insertions, 8 deletions
diff --git a/app/views/alerts/index.html.erb b/app/views/alerts/index.html.erb
index 458b951..c978bea 100644
--- a/app/views/alerts/index.html.erb
+++ b/app/views/alerts/index.html.erb
@@ -12,14 +12,18 @@
</thead>
<tbody>
- <% @alerts.each do |alert| %>
- <tr>
- <td><%= alert.author %></td>
- <td><%= alert.message %></td>
- <td><%= link_to 'Show', alert %></td>
- <td><%= link_to 'Edit', edit_alert_path(alert) %></td>
- <td><%= link_to 'Destroy', alert, method: :delete, data: { confirm: 'Are you sure?' } %></td>
- </tr>
+ <% 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><%= link_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>