I am using rails 3.2.6. I have added this in my models file:
has_one :avatar, :as => :imageable, :dependent => :destroy
validates_presence_of :avatar, :message => "can't be empty"
But I am not getting any error message if the field is left blank.I am only getting Please review the problems below:
at the top of my page. Can anyone suggest anything?
has_one :avatar, :as => :imageable, :dependent => :destroy
has_many :attachments, :as => :attachable, :dependent => :destroy
accepts_nested_attributes_for :avatar, :reject_if => :all_blank
Actually how to give error message in nested attributes?
来源:https://stackoverflow.com/questions/12796703/paperclip-not-displaying-the-error-message