Validation error overrides specified :collection =>
I have the following line in my view: f.association :company, :collection => @companies
This loads a collection of companies filtered based on the current tenant. If a validation error occurs on that form (for example a company is not selected from the dropdown), the form reloads - with the validation error, but the companies dropbox now contains every company instead of the filtered list for that tenant.
Ok, it looks like I didn't have the @companies variable defined in the create action of the controller. The rails form helper would give a nil error in this case, but simple_form just loads the association without any error. It would be nice to have an error in this instance to avoid accidental leakage. Thanks.
We have merged this recently: 2db82867b569824968e2131210981e868b834e62, that changes the way it handles it, instead of rendering the entire collection, it'll render an empty one. That's based on some discussion from #595. Thanks!
Just the answer I was looking for, solved my problem right away.