mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
56c9b3c2a6
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.
20 lines
356 B
Ruby
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
|