Reputation: 23289
In Ubuntu
, ruby 2.0.0p247
and Rails 4.0.0
when I use the following syntax
validates :title, presence: true, length: { minimun: 5 }
I get the exception Range unspecified. Specify the :in, :within, :maximum, :minimum, or :is option.
.
Also, if I write
validates :title, :presence => true, :minimun => 5
I get the exception Unknown validator: 'MinimunValidator'
.
How can I rewrite this so it works? As the guides says this should work, but it doesn't.
Upvotes: 0
Views: 479
Reputation: 38645
You have a typo (minimun
instead of minimum
) which is why the error:
validates :title, presence: true, length: { minimum: 5 }
Upvotes: 3