Hii
I need to pass an array of vlaues from by controller to the partial.
Please check my action in my controller
def dispfriends
@myfriend=[]
@myfriendlogin = []
@myusers=[]
i=0
@currentgroup = Group.find_by_id(params[:groupid])
puts @currentgroup.id
@currentfriends=
GroupFriend.find_all_by_user_id_and_group_id(current_user.id,@currentgroup.id)
for n in @currentfriends
@myfriend=n.friend_id
@myusers[i] = User.find_by_id(@myfriend)
@myfriendlogin[...@myusers[i]
puts @myfriendlogin[i]
i=i+1
end
@myfriendlogin.each do |user|
respond_to do |format|
format.html { render :partial => 'users/dispfriends', :collection =>
@myfriendlogin, :as => :user}
end
end
My Partial
<tr>
<td class="people_profile">
<div class="clear_float_effect">
<%= link_to user_image_tag(user, 50, :class => 'float_left
user_profile_image'), user %>
<div class="profile_text_details float_left">
<h5 class="page_heading"><%= hcard_link_to_user user.fullname,
user %></h5>
</div>
</div>
</td>
</tr>
I can only display one user. But, when comes to more than one user I get
"Template missing error".
Please check my action in the controller and help me in this regard.
Thank you.
--
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 [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.