Skip to content

Commit

Permalink
Add capture_compatibility_patch_enabled as option in known_issues.md (V…
Browse files Browse the repository at this point in the history
…iewComponent#1674)

* Add capture_compatibility_patch_enabled as option

Related to ViewComponent#1650 and ViewComponent#1644

* Update CHANGELOG.md

* Update docs/known_issues.md

* Update docs/known_issues.md

* reorder item

* make test more flexible to account for change in rails main

---------

Co-authored-by: Joel Hawksley <[email protected]>
Co-authored-by: Joel Hawksley <[email protected]>
  • Loading branch information
3 people authored and claudiob committed Dec 22, 2023
1 parent ac84662 commit f8fb6a1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ nav_order: 5

## main

* Document `config.view_component.capture_compatibility_patch_enabled` as option for the known incompatibilities with Rails form helpers

*Tobias L. Maier*

* Add support for experimental inline templates.

*Blake Williams*
Expand Down
1 change: 1 addition & 0 deletions docs/known_issues.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Passing a form object (often `f`) to a ViewComponent works for simple cases like

Some workarounds include:

- Experimental: Enable the capture compatibility patch with `config.view_component.capture_compatibility_patch_enabled = true`.
- Render an entire form within a single ViewComponent.
- Render a [partial](https://guides.rubyonrails.org/layouts_and_rendering.html#using-partials) within the ViewComponent which includes the form.
- Use a [custom `FormBuilder`](https://guides.rubyonrails.org/form_helpers.html#customizing-form-builders) to create reusable form components:
Expand Down
2 changes: 1 addition & 1 deletion test/sandbox/test/rendering_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ def test_validations_component
render_inline(ValidationsComponent.new)
end

assert_equal "Validation failed: Content can't be blank", exception.message
assert_includes exception.message, "Validation failed: Content"
end

def test_compiles_unrendered_component
Expand Down

0 comments on commit f8fb6a1

Please sign in to comment.