This project is archived and is in readonly mode.

#1057 ✓committed
Serdar Soydemir

validates_length_of does not accept custom messages when :within used

Reported by Serdar Soydemir | September 16th, 2008 @ 01:57 PM | in 2.x

validates_length_of does not accept custom messages when :within or :in used. Instead it shows standard error message.

Code to reproduce

validates_length_of :mobile,

                  :in => 10..20,
                  :on => :create,
                  :message => "Sample: 5329999999"

using :minimum and :maximum instead of :in works fine anyway

This is on 2.1.1

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Referenced by

Pages