NoMethodError in PlanVersions#objectives

Showing /app/app/views/objectives/index.html.erb where line #41 raised:

undefined method `admin?' for nil:NilClass
Extracted source (around line #41):
39
40
41
42
43
44
              
<td><%= objective.entity %></td>
<td>
<% if current_user.admin? %>
<%= link_to 'Excluir', objective, method: :delete, data: { confirm: 'Tem Certeza?' }, class:"btn" %>
<% end %>
</td>

Rails.root: /app

Application Trace | Framework Trace | Full Trace

Request

Parameters:

{"id"=>"1"}

Response

Headers:

None