Giter VIP home page Giter VIP logo

Comments (5)

stantoncbradley avatar stantoncbradley commented on September 16, 2024

We had the same issue. Check the docs now, rails_param takes a block for nested attributes and also handles arrays.

from rails_param.

odigity avatar odigity commented on September 16, 2024

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.

nicolasblanco avatar nicolasblanco commented on September 16, 2024

@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.

odigity avatar odigity commented on September 16, 2024

@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.

iMacTia avatar iMacTia commented on September 16, 2024

Closing this as main question as been addressed 👍 !

from rails_param.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.