Comments (5)
We had the same issue. Check the docs now, rails_param takes a block for nested attributes and also handles arrays.
from rails_param.
That is fantastic -- thanks!
PS-It annoys me that this gem isn't more popular, especially since it affects my decision of whether to use it. I think it's because it goes against the Rails way passing the data straight to a model build and letting the validations deal with them. But that way is so limited to the most basic, text-book case...
from rails_param.
@odigity : even if I've accepted a PR to support nested params, I still does not understand why you don't use ActiveModel::Model virtual classes to validate nested params. This feature is already included in Rails and support all the classical Rails validations out of the box.
I still think that if you need to validate nested params inside a controller you are already too far from the first goal of this gem and may break the "thin controller" rule.
from rails_param.
@nicolasblanco -- Why do you assume that all controller params always map to the concept of a model? And why do you assume ActiveModel validators is always the right way to validate input?
from rails_param.
Closing this as main question as been addressed 👍 !
from rails_param.
Related Issues (20)
- Parsing the date/time parameter depends on the local zone setting in the operating system, not in the Rails application HOT 3
- Hash Conversion Issue HOT 3
- params with value was overwrite by default HOT 1
- "in" doesn't throw an error when unexpected value given HOT 2
- when nil in required param `transform` fails HOT 4
- Unable to load application: NameError: uninitialized constant RailsParam::Param HOT 3
- [CI] Review Rails versions matrix HOT 5
- Move recursive logic into Validators
- Introduce an UPGRADING.md file
- Hash type validation HOT 6
- param! :foo, ActionDispatch::Http::UploadedFile will throw an exception when nil HOT 10
- Not an issue: Can we able validate the string length? HOT 1
- Array items error message not comprehensible HOT 2
- [Idea] Extract validation to external file HOT 5
- rails_param loads the whole rails suite HOT 2
- Wrong array to string coercion HOT 4
- when the param use default value, transform will not take effect HOT 1
- I want to allow arrays of nullable integer types. HOT 2
- InvalidParameterError does not contain "param" when coercion validation fails HOT 3
- automatically permit validated params HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rails_param.