Files
openproject/lib/primer/open_project/forms/html_content.rb
T
Alexander Brandon Coles 56c9b3c2a6 Simplify Forms #html_content implementation
This change also resolves issues with block scope after upgrading to
ViewComponent 4.0:

     ActionView::Template::Error:
       undefined local variable or method 'model' for an instance of #<Class:0x00000003020e3cb0>
     # ./app/forms/scim_clients/form.rb:93:in 'block (2 levels) in <class:Form>'
     # ./lib/primer/open_project/forms/html_content.rb:15:in 'BasicObject#instance_exec'

Additionally, since we are only interested in the passed `html_block`,
there is no need define a separate `HtmlContentInput` class.
2025-09-01 08:30:32 +01:00

20 lines
356 B
Ruby

# frozen_string_literal: true
module Primer
module OpenProject
module Forms
# :nodoc:
class HtmlContent < Primer::Forms::BaseComponent
def initialize(&html_block)
super()
@html_block = html_block
end
def perform_render(&)
super(&@html_block)
end
end
end
end
end