best-waiter-90128
09/17/2025, 2:27 PMindex_field_wrapper where custom ERB content gets ignored when the underlying field value is blank. The render_dash? method checks @field.value.blank? rather than whether custom content was provided, so users' ERB blocks execute (?) but their output is discarded in favor of showing "—".
It creates a confusing UX where providing custom content doesn't work unless you remember to add dash_if_blank: false. The option name dash_if_blank is also misleading - it sounds like it only controls dash display, but it actually determines whether custom content renders at all. It took me quite a while to figure out why my custom field wasn't rendering, and even then only discovered the fix by analyzing your implementation.
The issue also masks errors since the ERB runs but never renders, so you don't get feedback when your custom code has problems.
Would you consider checking if custom content exists before falling back to blank detection? Something like:
def render_dash?
return false if content.present?
if @field.type == "boolean"
@field.value.nil?
else
@field.value.blank? && @dash_if_blank
end
end
Something like that would respect user intent when they provide custom rendering while preserving the current behavior for standard field display.miniature-optician-85831
09/17/2025, 2:27 PMbest-waiter-90128
09/17/2025, 2:31 PMlemon-wall-20836
09/17/2025, 4:01 PMlemon-wall-20836
09/17/2025, 4:03 PMbest-waiter-90128
09/18/2025, 6:23 AMbest-waiter-90128
09/18/2025, 6:24 AMlemon-wall-20836
09/23/2025, 8:36 PMlemon-wall-20836
09/23/2025, 8:36 PMlemon-wall-20836
09/23/2025, 8:37 PM