Why does this model validator
validates_format_of :weight, :with => /\A\d{1,3}\.\d{0,2}\Z/, :on => :create
matches on
12.4kg
though it sould not
EDIT: the view form
<%= form_for :new_client do |f| %>
<% if @new_client.errors.any? %>
<div class="error_explanation">
<h2><%= pluralize(@new_client.errors.count, "error") %> prohibited data from being send:</h2>
<ul>
<% @new_client.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= f.label :weight %> <%= f.text_field :weight %><br/>
<%= f.label :height %> <%= f.text_field :height %><br/>
</div>
<div class="actions">
<%= f.submit %>
</div>
i check for all errors, i think, but the point is, that the weight should not be valid and should produce an error, but it doesn't.