Open teethgrinder opened 12 years ago
Hello , I am using amistad now. It is a nice gem but i can add a friend many times. Can you show me a way to avoid it? this is my link to add friends , I could avoid self friendship. :
<% unless current_user == @user %> <%= link_to "Arkadaşlarıma Ekle", friends_path(:user_id => @user), :method => :post,class: "btn btn-large btn-primary" %> <%end %>
current_user.friend_with?(@user)
You should also check pending invites.
current_user.pending_invited_by.include?(@user) current_user.pending_invited.include?(@user)
Hello , I am using amistad now. It is a nice gem but i can add a friend many times. Can you show me a way to avoid it? this is my link to add friends , I could avoid self friendship. :
<% unless current_user == @user %> <%= link_to "Arkadaşlarıma Ekle", friends_path(:user_id => @user), :method => :post,class: "btn btn-large btn-primary" %> <%end %>