我怎样才能让我的错误消息像这样有条件:
<% if object.errors.any? %>
<% if object.errors.count = 1 %>
Oops, an error was found.
<% else %>
Oops, <%= pluralize(object.errors.count, "errors") %> were found
<% end %>
<% object.errors.full_messages.each do |msg| %>
<%= msg %>
<% end %>
<% end %>
我现在得到一个undefined method count=
错误。正确的方法是什么?