In my model i had used the validation

validates :first_name,      :format => {:with => /^[a-zA-Z.\s]*$/
i}, :length => {:minimum => 1, :maximum => 25}, :presence => true

in views
<div class="field">
<%= f.label :first_name %>&nbsp;
<%= f.text_field :first_name %>
</div>

in the browser i am getting error messages 2 times like this


First name  is too short (minimum is 1 characters),can't be blank
is too short (minimum is 1 characters),can't be blank



On Jan 17, 3:20 pm, Colin Law wrote:
On 17 January 2012 08:56, Kapil Kaligotla

wrote:
I am using validations for first name, but I am getting error message
two times for the label and text_field,
<div class="field">
<%= f.label :first_name %>&nbsp;
<%= f.text_field :first_name %>
</div>
Show us the validation you have specified and what the error is and
why you think the error is wrong.  Otherwise what hope have we got of
helping?

Colin
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 4 of 6 | next ›
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedJan 11, '12 at 1:28p
activeJan 17, '12 at 6:47p
posts6
users3
websiterubyonrails.org
irc#RubyOnRails

People

Translate

site design / logo © 2021 Grokbase