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

Raise nicer error if no nested params are in the params sent to a form #41

Open
paulcsmith opened this issue Oct 29, 2017 · 0 comments
Open
Assignees
Labels
improve error experience Make errors nicer to deal with
Milestone

Comments

@paulcsmith
Copy link
Member

This still needs some thought. Please don't work on this yet

It can be confusing when using forms in this scenario

https://gitter.im/luckyframework/Lobby?at=59f61f2d5a1758ed0f645e2f

After further thought, I think it should raise a helpful error at runtime, but ALSO raise a compile time error if you try to pass it params and have no allowed any fields

Also consider user params.nested? instead of params.nested! and only raising when you actually try to save. That way you can instantiate a form without nested params, but when you save it, it'll give you an error if the form name is not there.

paulcsmith referenced this issue in luckyframework/lucky_record Dec 26, 2017
@paulcsmith paulcsmith self-assigned this Jan 12, 2018
@paulcsmith paulcsmith transferred this issue from luckyframework/lucky_record Feb 2, 2019
@jwoertink jwoertink added the improve error experience Make errors nicer to deal with label Jul 26, 2019
@paulcsmith paulcsmith added this to the Avram next milestone Aug 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improve error experience Make errors nicer to deal with
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants