Issue
I have this code:
<% @registered_friends.each do |friend| %>
<li><%= render 'profiles/fb_follow_form' %></li>
<% end %>
It renders a partial in a different directory with this line:
<% if current_user != nil && current_user.following?(friend) %>
However my app is telling me that friend
is undefined? How do I give myself access to the variable?
Solution
Changing <li><%= render 'profiles/fb_follow_form' %></li>
to <li><%= render 'profiles/fb_follow_form', :friend => friend %></li>
should do it
Answered By - AaronThomson Answer Checked By - Cary Denson (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.