Skip to content

Commit 4b35a2e

Browse files
committed
Add upgrade instructions
1 parent 33eb295 commit 4b35a2e

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,40 @@ Rails classes have been moved into separate files for better organization:
4343

4444
### How to Upgrade
4545

46+
#### Phlex 2.x compatibility
47+
48+
The `ApplicationForm` file should be moved to `Components::Form` at `./app/components/form.rb` to better match Phlex 2.x conventions.
49+
50+
```ruby
51+
# Before (0.5.x)
52+
class ApplicationForm < Superform::Rails::Form
53+
# ...
54+
end
55+
```
56+
57+
```ruby
58+
# After (0.6.0)
59+
class Components::Form < Superform::Rails::Form
60+
# ...
61+
end
62+
```
63+
64+
Form variants may organized in the `./app/components/forms/` directory.
65+
66+
```ruby
67+
# Before (0.5.x)
68+
class Forms::User < ApplicationForm
69+
# ...
70+
end
71+
```
72+
73+
```ruby
74+
# After (0.6.0)
75+
class Forms::User < Components::Form
76+
# ...
77+
end
78+
```
79+
4680
#### Custom Form Classes
4781

4882
Custom form classes with Rails now automatically pass themselves as form instances (no changes needed for basic usage).

0 commit comments

Comments
 (0)