Estoy realizando el curso de udemy de ruby on rails y tengo este error
ActionView::Template::Error (undefined method `full_name' for nil:NilClass)
Acá tengo definido el método:
def full_name
return "#{first_name} #{last_name}" if first_name || last_name
"anonymous"
end
Este es mi partial _friend_result.html.erb
<% if @friends %>
<div class="card card-header result-search">
<% @friends.each do |friend| %>
<strong>Name: </strong><%= @friend.full_name %>
<strong>Email: </strong><%= @friend.email %>
<strong>Actions </strong><%= link_to "View Profile", '#', class:"btn btn-small btn-success"%>
<%= link_to 'Follow', '#',
class:"btn btn-success", method: :post %>
<% end %>
</div>
<% end %>