better regular expression that actually works
git-svn-id: http://svn.barleysodas.com/barleysodas/trunk@17 0f7b21a7-9e3a-4941-bbeb-ce5c7c368fa7master
parent
6b2883d260
commit
c06aaba80c
|
@ -16,7 +16,7 @@ class Page < ActiveRecord::Base
|
||||||
belongs_to :owner, :polymorphic => true
|
belongs_to :owner, :polymorphic => true
|
||||||
validates_presence_of :title
|
validates_presence_of :title
|
||||||
validates_uniqueness_of :title, :scope => 'owner_type'
|
validates_uniqueness_of :title, :scope => 'owner_type'
|
||||||
validates_format_of :title, :with => /[A-Za-z0-9 ]/,
|
validates_format_of :title, :with => /^([A-Za-z0-9 ])+$/,
|
||||||
:message => 'may only contain letters, numbers and spaces'
|
:message => 'may only contain letters, numbers and spaces'
|
||||||
before_save :update_html
|
before_save :update_html
|
||||||
|
|
||||||
|
|
Reference in New Issue