I have view, which render users of my app. I want to make partial, which consists necessary fields, and pass to it local variable
users/index
- @vk = VkontakteApi::Client.new
- fields = [:first_name, :last_name, :url, :photo_medium, :sex, :bdate]
- @vk.friends.get(uid: current_user.uid, fields: fields) do |friend|
%td.span
.centred
= render 'shared/users', locals: { friend: friend }
shared/users
- @vk = VkontakteApi::Client.new
- fields = [:first_name, :last_name, :url, :photo_medium, :sex, :bdate]
%span= image_tag friend.photo_medium
%span= friend.uid
%span= friend.name
But if i try it there is an error
undefined local variable or method `friend'
Thanks! If you need more information, please comment about it