Extract method to render special avatars in comments

This commit is contained in:
Javi Martín
2024-04-11 17:15:41 +02:00
parent 67b1518858
commit c655edddde
2 changed files with 9 additions and 3 deletions

View File

@@ -4,4 +4,10 @@ class Comments::AvatarComponent < ApplicationComponent
def initialize(comment)
@comment = comment
end
private
def special_avatar(image_name, options = {})
image_tag(image_name, { size: 32, alt: "" }.merge(options))
end
end