Skip to content

Commit 96bb958

Browse files
tmaierjoelhawksley
andauthored
Add capture_compatibility_patch_enabled as option in known_issues.md (#1674)
* Add capture_compatibility_patch_enabled as option Related to #1650 and #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]>
1 parent 7fef076 commit 96bb958

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

docs/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ nav_order: 5
1010

1111
## main
1212

13+
* Document `config.view_component.capture_compatibility_patch_enabled` as option for the known incompatibilities with Rails form helpers
14+
15+
*Tobias L. Maier*
16+
1317
* Add support for experimental inline templates.
1418

1519
*Blake Williams*

docs/known_issues.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Passing a form object (often `f`) to a ViewComponent works for simple cases like
2222

2323
Some workarounds include:
2424

25+
- Experimental: Enable the capture compatibility patch with `config.view_component.capture_compatibility_patch_enabled = true`.
2526
- Render an entire form within a single ViewComponent.
2627
- Render a [partial](https://guides.rubyonrails.org/layouts_and_rendering.html#using-partials) within the ViewComponent which includes the form.
2728
- Use a [custom `FormBuilder`](https://guides.rubyonrails.org/form_helpers.html#customizing-form-builders) to create reusable form components:

test/sandbox/test/rendering_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ def test_validations_component
415415
render_inline(ValidationsComponent.new)
416416
end
417417

418-
assert_equal "Validation failed: Content can't be blank", exception.message
418+
assert_includes exception.message, "Validation failed: Content"
419419
end
420420

421421
def test_compiles_unrendered_component

0 commit comments

Comments
 (0)