File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
4882Custom form classes with Rails now automatically pass themselves as form instances (no changes needed for basic usage).
You can’t perform that action at this time.
0 commit comments