0
可能重复:
Paperclip not displaying the error message回形针不显示任何错误消息
我使用Rails 3.2.6。我在我的模型文件中添加了这个:
has_one :avatar, :as => :imageable, :dependent => :destroy
validates_presence_of :avatar, :message => "can't be empty"
但如果字段保留blank.I我只在我的页面的顶部越来越Please review the problems below:
我没有收到任何错误消息。任何人都可以提出建议
我也试过:
validates :avatar, :presence => {:message => 'Please select the image'}
实际上它是accepts_nested_attributes:HAS_ONE:化身:为=>:可成像,:依赖=>:破坏 的has_many:附件,:为=>:可附接,:依赖=>:破坏 accepts_nested_attributes_for:化身 –
我做:reject_if =>:all_blank,它不允许我走得更远,但不显示错误消息。 –
是否显示其他字段错误?也许你的代码显示错误是问题? –