diff options
Diffstat (limited to 'app/views/alerts')
-rw-r--r-- | app/views/alerts/index.html.erb | 20 | ||||
-rw-r--r-- | app/views/alerts/show.html.erb | 4 |
2 files changed, 13 insertions, 11 deletions
diff --git a/app/views/alerts/index.html.erb b/app/views/alerts/index.html.erb index 458b951..1d441a2 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 %></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> diff --git a/app/views/alerts/show.html.erb b/app/views/alerts/show.html.erb index eeab7f7..59d8094 100644 --- a/app/views/alerts/show.html.erb +++ b/app/views/alerts/show.html.erb @@ -1,8 +1,6 @@ -<p id="notice"><%= notice %></p> - <p> <strong>Author:</strong> - <%= @alert.author %> + <%# @alert.author %> </p> <p> |