Skip to main content
3 of 3
edited tags
tokland
  • 11.2k
  • 1
  • 21
  • 26

Refactor ruby each-code

def users_list  
  html = ''  
  self.users.each do |user|  
    html << user.link_avatar_tag  
  end  
  html.html_safe  
end  

I feel that it is possible to write shorter.

Is it possible get rid of the temporary variable(html)?