Open ditsara opened 5 years ago
I think this is a fantastic idea! I'd love some help with this. It may be hard to track down everything, but if you get it started and open a PR I'm happy to fill in the gaps or point to files/methods that need some work.
Thanks so much for opening this!
I was about to file the same issue regarding forms, specifically feedback with errors; presently under "Saving Data with Forms", it only mentions .valid?
and .saved?
which isn't enough to tell what the error was if there was one.
I'm not quite sure how the best way to go about that would be but I believe mentioning something about errors
and fields
and how to use them. I think maybe it could be something similar to the reduce
usage in Avram::FormErrors
And I know the guide says "They return a Avram::Field
that contains the value of the field, the name of the field, the param value, and any errors the field has." but I guess for me, if it's not specified as errors
, I interpret it as being part of the sentence, not a callable method.
Coming from Rails to Lucky/Crystal, I think it'd be useful to have a reference in the guides for the macro-generated methods. Having a top-level understanding of the magic that's happening inside the macros would really help with getting people started.
For example, see: https://guides.rubyonrails.org/association_basics.html#detailed-association-reference
Classes that could be documented:
Happy to write/contribute if others think this is a good idea.