我正在使用 Zurb Foundation 和 Simple form
<%= simple_form_for @complaint do |f| %>
<%= f.error_notification %>
<%= f.association :company, as: :radio, label: false %>
<%= f.input :country, priority: ["United States"] %>
<%= f.input :city %>
<%= f.input :client, placeholder: 'Coca-Cola' %>
<%= f.input :body %>
<%= f.button :submit %>
<% end %>
在我的模型中:
class Complaint < ActiveRecord::Base
belongs_to :company
attr_accessible :body, :city, :client, :country, :company_id
validates :company, presence: { message: 'Company cannot be blank!' }
validates :body, presence: true
validates :country, presence: true
validates :city, presence: true
end
当我在空表单上单击提交时,我预计会出现“公司不能为空白!”的错误。等等
我使用<%= f.error_notification %>
不正确吗?我怎样才能到那里显示错误?