Class: Ckpages::Page

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/ckpages/page.rb

Instance Method Summary collapse

Instance Method Details

#normalizeObject



7
8
9
10
11
12
13
14
# File 'app/models/ckpages/page.rb', line 7

def normalize
  self.path = self.path.gsub(/\A\/+/, '')
  self.path = self.path.gsub(/\/+\z/, '')
  self.path = self.path.gsub(/\A\s+/, '')
  self.path = self.path.gsub(/\s+\z/, '')
  self.path = '/' + self.path

end