Module: ActionView::Component::TestHelpers

Defined in:
lib/action_view/component/test_helpers.rb

Instance Method Summary collapse

Instance Method Details

#render_component(component, **args, &block) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/action_view/component/test_helpers.rb', line 10

def render_component(component, **args, &block)
  ActiveSupport::Deprecation.warn(
    "`render_component` has been deprecated in favor of `render_inline`, and will be removed in v2.0.0."
  )

  render_inline(component, args, &block)
end

#render_inline(component, **args, &block) ⇒ Object



6
7
8
# File 'lib/action_view/component/test_helpers.rb', line 6

def render_inline(component, **args, &block)
  Nokogiri::HTML(ApplicationController.new.view_context.render(component, args, &block))
end