New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable use for plain ruby classes #91
Enable use for plain ruby classes #91
Conversation
allows `fdescribe, fcontext, fit` spec running
These are compiled/generated by yarn/npm install and should not be in source control.
To test the formbuilder components use against a plain ruby class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this looks good. Before this was raised I'd already created #90 which does more or less the same thing. If you're happy for me to I'll cherry pick the tests from this PR into that one and tweak accordingly. Thanks @jsugarman
@@ -65,6 +65,8 @@ def error_summary_title_id | |||
end | |||
|
|||
def object_has_errors? | |||
return unless @builder.object.respond_to?(:errors) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the builder should error if the dev tries to render an error summary in a form with an object that doesn't support errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this looks good. Before this was raised I'd already created #90 which does more or less the same thing. If you're happy for me to I'll cherry pick the tests from this PR into that one and tweak accordingly. Thanks @jsugarman
Yep, what ever you think is best.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the builder should error if the dev tries to render an error summary in a form with an object that doesn't support errors
👍 Makes sense, better to catch these things early.
What
Allow creation of GDS design system form components for plain ruby classes. Issue.
Why
Inline with standard rails form builder helpers and to facilitate creation of simple forms with no models associated.
For example to create a simple search form it would be nice to not have to create any model and just do something like
Currently this is only prevented by the use of calls to
errors
, from what i can see.