Module: Cms::Module

Included in:
Engine
Defined in:
lib/cms/module.rb

Overview

All BrowserCMS modules will:

  1. Add app/portlets to the loadpath

  2. Serve static assets from their public directory.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.current_namespaceObject



14
15
16
# File 'lib/cms/module.rb', line 14

def self.current_namespace
  @ns
end

.current_namespace=(ns) ⇒ Object



10
11
12
# File 'lib/cms/module.rb', line 10

def self.current_namespace=(ns)
  @ns = ns
end

Instance Method Details

#routesObject

This is a bit of a hack, but we need to store the current namespaces so that module developers can just write:

BcmsZoo::Engine.routes.draw do

<tt>content_blocks :bear</tt>

end

And have it correctly find the right namespaced class model (i.e. BcmsZoo::Bear)



37
38
39
40
# File 'lib/cms/module.rb', line 37

def routes
  Module.current_namespace = ::Cms::EngineHelper.module_name(self.class)
  super
end