Module: Transit::Definition::Page

Extended by:
ActiveSupport::Concern
Defined in:
lib/transit/definitions/page.rb

Overview

A page defines any full page-like model within a site. Pages have the same properties as standard html pages, including a title, a slug (url), keywords and descriptions.

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary (collapse)

Instance Method Details

- (String) full_path

Convenience method for returning the full path to this page.



90
91
92
93
# File 'lib/transit/definitions/page.rb', line 90

def full_path
  return self.slug if [self.path].flatten.compact.empty?
  self.path.dup.join("/")
end

- (Boolean) pages?



95
96
97
# File 'lib/transit/definitions/page.rb', line 95

def pages?
  self.send(:#{self.class.name.pluralize.underscore}").published.exists?
end