Can this be refactored?

1. Lazy evaluation helps you eliminating nested conditions.

<% if session[:person_id] and != session[:person_id] and
not @referrals.any? {|r| r.giver_id == session[:person_id]} %>
<%= render :partial => 'referrals/form' %>
<% else %>
<p><em>Please log in to add a referral for <%= @person.full_name %></em></p>
<% end %>

2. I think this is ok in view but sometimes it is better to hide
complex conditions like this in model.

Best regards,