luckyframework / luckyframework/avram

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

Open
#41 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

improve error experience
Dominant language
Crystal
Stars
183
Forks
67
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the linked Gitter discussion and tracing Avram's form parameter handling, since the issue names no files or tests. Clarify the intended runtime and compile-time behavior, including when validation should occur, before identifying tests that define the completed error behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
crystal
Domain
databases
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.