-
Notifications
You must be signed in to change notification settings - Fork 89
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
Remove the "nested attributes" feature #31
Comments
Personally I need this feature. |
@adisos : that's great if you like nested attributes. Please be a little more detailed and explain why you cannot or don't want to use the built-in Rails ActiveModel::Model module to validate nested objects? Why should we reinvent the wheel? Rails philosophy is all about DRY, right? |
I really don't like AM. I'm using Trailblazer for complex forms and also dry-validation. And this gem is really cool for fast development. |
This library should not be used to validate a large number of parameters or parameters.... |
rails_params is very usefully for validating bodies and url parameters for basic APIs, and so far works quite well. APIs can have more involved input structures than traditional controllers that just render HTML, and it's not rare for data to be nested at more than one level. This is seems like a primitive feature of any web input validation library and I think it should stay IMO. I think the minimalist philosophy is nice, but I think there is more value in allowing this feature to remain. Also worth noting that it still feels quite minimalist even with recursion about Strong parameters: it can validate presence, but doesn't help with types and hence quickly becomes useless beyond the basic security contraints it provides. |
I'm thinking of removing the "nested attributes" feature to stay in the philosophy of a minimalist gem.
To validate nested attributes you can do this easily with an ActiveModel::Model class. Also you can validate the presence of the nested objects using Strong parameters and the
require
method on the params object.If you have any opinion on this, please comment!
The text was updated successfully, but these errors were encountered: