Class: Page

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

Instance Method Summary collapse

Instance Method Details

#clean_urlObject



15
16
17
# File 'app/models/page.rb', line 15

def clean_url
  title.to_s.downcase.gsub(/[^a-z0-9\s]/, '').gsub(/\s/,'-')
end

#robotsObject



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

def robots
  out = []
  out << 'noindex' if noindex?
  out << 'nofollow' if nofollow?
  out.join(', ')
end

#set_urlObject



19
20
21
# File 'app/models/page.rb', line 19

def set_url
  self.url ||= clean_url
end