Referred by |
<% if @user.referred? %>
<%= link_to(@user.referred_by.email, edit_admin_user_url(@user.referred_by)) %>
<% elsif @user.affiliate? %>
<%= link_to(@user.affiliate.name, edit_admin_affiliate_url(@user.affiliate)) %>
<% else %>
Organic
<% end %>
|
Referral code |
<%= @user.referral.code %> |
Referred orders |
<%= "No referred orders yet." if @user.referral.referred_orders.count == 0 %>
<% @user.referral.referred_orders.each do |order| %>
- <%= link_to order.number, edit_admin_order_path(order) %> (<%= order.state %>)
<% end %>
|
Users referred |
<%= "No referred users yet." if @user.referred_count == 0 %>
<% @user.referral.referred_users.each do |user| %>
- <%= link_to user.email, edit_admin_user_url(user) %>
<% end %>
|
CODE
end