不显示simple_form错误通知我使用Zurb基金会和简单的形式使用zurb基础
<%= 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 %>
不正确? 我怎样才能到那里显示错误?
对不起,我不再工作在该回购,并没有控制器代码。 – emailnitram