Monday, June 7, 2010

[Rails] help with a daft question....:-)

Hello, I am hoping somwone can help with this....

Basically I have a website and I want to display a list of users
currently using the site, prior to someone logging in.

In a sense, it is a way for people to view a profile before logging
in, and then they can choose whether or not to add them as a friend,


SO - I have a login page which contains a link to a partial:

<%= render :partial => "user/friendlist" %>

in the friendlist file I have the following:

<% @users.each do |user| %>


<%= link_to thumbnail_tag(user), profile_for(user) %>
<%= link_to user.username, profile_for(user) %>

<% end %>

However, the login page cannot render with this code as it complains
about a nil object: (see below)

You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.each

What do I need to amend or add in oder for this to work?

Kind regards & thanks for reading

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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate