Module: ViewComponent::Form::TestHelpers
- Defined in:
- lib/view_component/form/test_helpers.rb
Instance Method Summary collapse
- #form_with(object, builder: ViewComponent::Form::Builder, **options) ⇒ Object
- #object_name ⇒ Object
- #template ⇒ Object
Instance Method Details
#form_with(object, builder: ViewComponent::Form::Builder, **options) ⇒ Object
10 11 12 |
# File 'lib/view_component/form/test_helpers.rb', line 10 def form_with(object, builder: ViewComponent::Form::Builder, **) builder.new(object_name, object, template, ) end |
#object_name ⇒ Object
14 15 16 |
# File 'lib/view_component/form/test_helpers.rb', line 14 def object_name :user end |
#template ⇒ Object
19 20 21 22 23 |
# File 'lib/view_component/form/test_helpers.rb', line 19 def template lookup_context = ActionView::LookupContext.new(ActionController::Base.view_paths) ActionView::Base.new(lookup_context, {}, ApplicationController.new) end |