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

Transforming request parameters for the safe_params feature #45

Open
arni1981 opened this issue May 24, 2021 · 0 comments
Open

Transforming request parameters for the safe_params feature #45

arni1981 opened this issue May 24, 2021 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@arni1981
Copy link

Feature request:

Rails sends form parameters for date_select as...

{:"date(1i)"=>2021, :"date(2i)"=>5, :"date(3i)"=>20}

I want to validate this against my schema.

required(:date).filled(:date)

Currently I need to do some pre-transforming of the parameters for this to work, having a built-in way to do this in Rails would be really nice.


Background:

This was talked about here: https://www.reddit.com/r/ruby/comments/niceer/dryschema_and_dryvalidation_gems/
and here: https://dry-rb.zulipchat.com/#narrow/stream/191662-general/topic/dry-schema/near/239935781

@arni1981 arni1981 added bug Something isn't working help wanted Extra attention is needed labels May 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant