for n in @currentfriends
@myfriend=n.friend_id
puts @myfriend @myusers = User.find_by_id(@myfriend) @myfriendlogin[i][email protected]
puts @myfriendlogin[i]
i=i+1
end
I can print @myfriendlogin (id, name, address) individually and show the
value in the view. But,
My requirement is I need to pass complete @myusers array to my view.
Please help like how can i pass all the fields in @myusers.
for n in @currentfriends
@myfriend=n.friend_id
puts @myfriend @myusers = User.find_by_id(@myfriend) @myfriendlogin[i][email protected]
puts @myfriendlogin[i]
i=i+1
That’s not how you do it in Ruby. Learn about Array methods such as
each and collect.
end
I can print @myfriendlogin (id, name, address) individually and show the
value in the view. But,
My requirement is I need to pass complete @myusers array to my view.
Please help like how can i pass all the fields in @myusers.
It’s just a variable. Pass it like any other variable.