Ash and AshPhoenix error key needs to be "foreign_resource_id", not "foreign_resource"..

There is a resource "A", and it includes belongs_to :foreign_resource, ForeignResource, and foreign_resource_id column. In phoenix liveview form, after validation I expect error with key "foreign_resource_id" needs to be exist, but only "foreign_resource" error exists. Can I get error with key "foreign_resource_id"?
4 Replies
ZachDaniel
ZachDaniel•3y ago
🤔 what is the error that you’re seeing? There is a transform_errors option IIRC that can be given to the form when you create it to remap errors Which can help in the short term
rapidfsub
rapidfsubOP•3y ago
Oh, I'll look into transform_errors option. Thanks. By the way, my error is simple. Just "required" because of allow_nil? false.
ZachDaniel
ZachDaniel•3y ago
Ah, yeah I see what you mean. I think we can do that can you make an issue on github?
rapidfsub
rapidfsubOP•3y ago
Ok. I will.

Did you find this page helpful?