Skip to content
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

Allow plain ruby objects #90

Merged
merged 4 commits into from Jan 7, 2020
Merged

Allow plain ruby objects #90

merged 4 commits into from Jan 7, 2020

Conversation

peteryates
Copy link
Member

Allow the form builder to operate with plain Ruby objects in addition to ActiveModel and ActiveRecord ones that support #errors. This is useful when performing transient operations like searching.

This allows non-ActiveModel/ActiveRecord objects to be used by the form
builder, it's sometimes useful when working with transient data; an
example would be searches.

Fixes #88
@peteryates peteryates added the enhancement New feature or request label Jan 7, 2020
jsugarman and others added 2 commits January 7, 2020 14:15
To test the formbuilder components use against
a plain ruby class.
This will highlight that there's a problem if a developer attempts to
use the #govuk_error_summary in a form where the object doesn't respond
to #errors. Also reformat and tidy up the examples file.

The Naming/MethodParameterName cop is now disabled because it thinks two
letter method params are bad (we're using :cv) 🤦
@peteryates
Copy link
Member Author

@jsugarman, would you mind giving this branch a spin and if it's all good I'll merge and get a mini release (with this and #89) prepped. Thanks

@peteryates peteryates merged commit fcb56d1 into master Jan 7, 2020
@peteryates peteryates deleted the allow-plain-ruby-objects branch January 7, 2020 17:48
peteryates added a commit that referenced this pull request Jan 9, 2020
Allow the form builder to work with plain ruby objects
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants