79705974

Date: 2025-07-18 09:35:48
Score: 0.5
Natty:
Report link

Well, doing some more experiments following the suggestions on commentators, to who many thanks, I tried simply moving the helper, without view_context and helper_method declaration out of the controller and into a helper (i.e., app/helpers/component_helper.rb)

module ComponentHelper
  def render_image_modal(**kwarg)
    render(ImageModalComponent.new(**kwarg)) do |component|
      yield component
    end
  end
end

and suddenly everything works.

Reasons:
  • Blacklisted phrase (0.5): thanks
  • Has code block (-0.5):
  • Self-answer (0.5):
Posted by: jjg