Hi There,

I'm looking to improve my search results by allowing a thumbnail of
returned users to be displayed,

I currently have a table that shows:

<th> thumbnail here </th> <th>Last Name  <th>Gender</th> <th>Location</
th> <th>Preference</th>

what i'd like is to be able to add the user's thumbnail to it.

So far I have my search results page:

        <td><%= user.info.lastname %></td>
        <td><%= user.info.location %></td>
        <td><%= user.info.pref %></td>

I tried to add the following:
        <% @user.friends.each do |friend| %>

<%= link_to thumbnail_tag(friend), profile_for(friend) %>

        <% end %>

Unfortunately, this returns with:
You have a nil object when you didn't expect it!
The error occurred while evaluating nil.friends

I know it's to do with the <% @user.friends.each do |friend| %>  line,
but i can't seem to overcome this, despite an evening of google
searches.

Can anyone help?


thanks :-)

--

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


Reply via email to