Class: InnerPlan::UserWithAvatarComponent
- Inherits:
-
Phlex::HTML
- Object
- Phlex::HTML
- InnerPlan::UserWithAvatarComponent
- Includes:
- Phlex::Rails::Helpers::ImageTag
- Defined in:
- app/components/inner_plan/user_with_avatar_component.rb
Instance Method Summary collapse
-
#initialize(user, avatar_size: 20) ⇒ UserWithAvatarComponent
constructor
A new instance of UserWithAvatarComponent.
- #template ⇒ Object
Constructor Details
#initialize(user, avatar_size: 20) ⇒ UserWithAvatarComponent
Returns a new instance of UserWithAvatarComponent.
5 6 7 8 |
# File 'app/components/inner_plan/user_with_avatar_component.rb', line 5 def initialize(user, avatar_size: 20) @user = user @avatar_size = avatar_size end |
Instance Method Details
#template ⇒ Object
10 11 12 13 14 15 |
# File 'app/components/inner_plan/user_with_avatar_component.rb', line 10 def template image_tag(@user.inner_plan_avatar_url, size: @avatar_size, class: 'rounded-circle me-1', style: 'margin-top:-0.1rem') plain @user.inner_plan_to_s end |