This commit is contained in:
David Gil
2015-08-12 18:31:44 +02:00
parent bf95e55345
commit 2f41341ca8

View File

@@ -4,9 +4,8 @@ module UsersHelper
klass = options.fetch(:class) { '' }
round_corners = options.fetch(:round_corners) { true }
data_attributes = { height: size, width: size, "font-size" => (size * 0.6) }
data_attributes = { name: user.name, height: size, width: size, "font-size" => (size * 0.6) }
data_attributes.merge!(radius: (size * 0.13).round) if round_corners
data_attributes.merge!(name: user.name)
content_tag :img, nil, class: "avatar #{klass}", data: data_attributes
end