sferik/rails_admin — Issue #783: validation/error messages for polymorphic associations?
Author: kimerseen
Created: 2011-10-17 14:27:28+00:00
State: open

how to add an error message to a polymorphic association?
here is an example:

when adding a new player and validating a presence of draft:

class Player < ActiveRecord::Base
.....
has_one :draft, :as => draftable
validates_presence_of :draft # make a field required not optional
.....
end

then, when saving the player with empty draft, it flashes: Player failed to be created, but does not output an error message on the required field, draft.

BR,
kimerseen