mirror of
https://github.com/we-promise/sure.git
synced 2026-05-30 15:59:02 +00:00
Goals::AvatarComponent had `attr_reader :icon` which shadowed the global `icon` view helper. Template called `icon(icon, size:, color:)` which Ruby resolved against the attr-reader (zero-arity), throwing "wrong number of arguments (given 2, expected 0)" the moment a goal had a saved icon and the show page tried to render its avatar. - Drop `:icon` from attr_reader; expose as `icon_name` instead. - Template uses `helpers.icon(icon_name, ...)` matching the Goals::StatusPillComponent pattern (other Goals VCs already use `helpers.icon`). Reproduced + verified live via Playwright: edit modal → pick an icon → save → show page renders the new avatar with the SVG. Same for create flow (new modal → pick icon → step 2 → submit → show renders).
11 lines
395 B
Plaintext
11 lines
395 B
Plaintext
<span class="goal-avatar inline-flex items-center justify-center font-semibold <%= box_classes %> <%= text_classes %> <%= radius_classes %>"
|
|
style="--avatar-color: <%= color %>;"
|
|
aria-hidden="true"
|
|
data-testid="goal-avatar">
|
|
<% if icon_name.present? %>
|
|
<%= helpers.icon(icon_name, size: icon_size, color: "current") %>
|
|
<% else %>
|
|
<%= initial %>
|
|
<% end %>
|
|
</span>
|