Class: Page
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Page
- Defined in:
- app/models/page.rb
Instance Method Summary collapse
Instance Method Details
#clean_url ⇒ Object
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 |
#robots ⇒ Object
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_url ⇒ Object
19 20 21 |
# File 'app/models/page.rb', line 19 def set_url self.url ||= clean_url end |