hello ther,

If I view my profile within my application, I can see 2 links. 1 = get
in touch and 2 = friend request.

Obviously if this is my own profile, I dont want to contact myself,
nor add myself as a friend.

So - I had this that I found in the book:

<% if logged_in? and @user != @logged_in_user %>

When added to the page which shows my profile, it looks like this:

<% if logged_in? and @user != @logged_in_user %>
<div class="users_profile">
<h2>
<span class="header">Actions</span>
<br clear="all" />
</h2>
<ul>

        <li> <%= link_to "Get in touch",
                                                                          
:controller => "email",
                                                                          
:action => "correspond",
                                                                          :id 
=> @user.username %>

        </li>

        <li> <%= friendship_status(@logged_in_user, @user) %>
                 <% unless Friendship.exists?(@logged_in_user, @user) %>


        <%= link_to "Buddy up with #[email protected]}",
                        { :controller => "friendship", :action => "create",
                          :id => @user.username },
                          :confirm =>   "Send buddy request to 
#[email protected]}?" %>

        <% end %>


        <% end %>


</ul>

</div>

However - even with this in place, I still get the links to contact
myself, and add myself as a friend.

I then thought - perhaps I could add the hide_edit_links to the links
i wish to hide.

So I added; <% unless hide_edit_links? %> before the 2 links.
Unfortunately this only seems to hide these for all users. So - if i
view someone e;ses profile, I cannot email them or add as a friend.

Any suggestions how I hide these links, without hiding all links?

Thanks for reading - hope someone can help.

--

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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.


Reply via email to