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)?
I feel that it is possible to write shorter. Is it possible get rid of the temporary variable(html)? |
||||
show 1 more comment |
You should use
|
|||||||
|
html_safe
is no standard method for String - What gems are you using? Or in short: Can you provide a MWE? And to answer: It looks ok for me. – knut Jan 7 at 15:08html_safe
comes from. – tokland Jan 7 at 16:41self.users
, is this a model? a helper? – tokland Jan 8 at 8:39