RRUI-003 · Button · Form builder
f.rui_button drops the icon slot blockIcons worked with standalone rui_button, but the same with_icon block on form.rui_button never rendered — the FormBuilder method did not forward the block to render_in.
f.rui_* methods were audited; the ten that had the same gap were fixed, and a permanent parity test suite was added so this class of bug cannot come back quietly. Broader form-builder hardening (Rails-compatible index:/string args, etc.) continued in v0.53.0.
| Surface | RapidRailsUI::FormBuilder#rui_button |
|---|---|
| Status | Fixed in 0.51.2
|
| Cause | Wrapper never accepted / forwarded &block to render_in
|
| Now | Block forwarding across audited f.rui_* methods + parity tests |
<%= form_with model: @record do |form| %>
<%= form.rui_button("Send Enquiry", type: :submit, color: :primary) do |button| %>
<% button.with_icon(name: :pencil, position: :trailing) %>
<% end %>
<% end %>
rui_button — trailing icon rendered.Contrast — this always worked:
<%= rui_button("Send Enquiry", type: :submit, color: :primary) do |button| %>
<% button.with_icon(name: :send, position: :trailing) %>
<% end %>
def rui_button(*args, **kwargs, &block)
rapidui_component Button::Component, *args, **kwargs, &block
end
def rui_button(text = nil, **options)
RapidRailsUI::Button::Component.new(
text,
form: self,
**options
).render_in(@template) # ← no &block
end
Ruby silently discarded the caller’s block when the method neither yielded nor took &block.
&block to render_in.f.rui_* methods; ten with the same gap fixed.def rui_button(text = nil, **options, &block)
RapidRailsUI::Button::Component.new(
text,
form: self,
**options
).render_in(@template, &block)
end