Hi,
I''m using HasManyFriends plugin.
I''m listing friends so users can request friendship. From those I have
to remove the admin, the current user and users that are friends
already.
For that I used this:
def index
@users = User.find(:all)
render :inline =>
"<% for user in @users %>
<% if !user.has_role?(''administrator'') &&
user != current_user &&
(!user.is_friends_with? current_user) %>
<%=h user.login %>
<%= link_to ''Invite this user'', :action =>
''process_invitation'',
:invite => user ,:command => ''invite'' unless
(user.has_role?(''administrator'') || user == current_user)
%>
<br>
<% end %>
<% end %>"
end
I think that''s not the most optimal way.
Any hints how to do it better?
Note, I''m planning to include a city filter for the first user fecth
soon.
Thanks
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---