Defining new page types in an extension

What’s the best way to define new page types in an extension?

I created some classes that extend StandardPage, but they aren’t loaded.
(Don’t appear in the page type drop-down)

/Users/igotimac/radiant_svn_v2/facets/radiant/public/…/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:266:in
load_missing_constant': uninitialized constant StandardPage (NameError) from /Users/igotimac/radiant_svn_v2/facets/radiant/public/../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:452:inconst_missing’
from
/Users/igotimac/radiant_svn_v2/facets/radiant/public/…/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:464:in
const_missing' from /Users/igotimac/radiant_svn_v2/facets/radiant/vendor/extensions/page_attributes/app/models/content_from_template_page.rb:4 from /Users/igotimac/radiant_svn_v2/facets/radiant/public/../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:203:inload_file’
from
/Users/igotimac/radiant_svn_v2/facets/radiant/public/…/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:342:in
new_constants_in' from /Users/igotimac/radiant_svn_v2/facets/radiant/public/../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:202:inload_file’
from
/Users/igotimac/radiant_svn_v2/facets/radiant/public/…/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:94:in
require_or_load' from /Users/igotimac/radiant_svn_v2/facets/radiant/public/../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:248:inload_missing_constant’
… 12 levels…
from
/Users/igotimac/radiant_svn_v2/facets/radiant/public/…/config/…/vendor/rails/railties/lib/initializer.rb:43:in
run' from /Users/igotimac/radiant_svn_v2/facets/radiant/public/../config/../lib/radiant/initializer.rb:32:inrun’
from
/Users/igotimac/radiant_svn_v2/facets/radiant/public/…/config/environment.rb:10
from
/Users/igotimac/radiant_svn_v2/facets/radiant/public/dispatch.fcgi:21

I reference my page extensions during the load of the extension:

http://soxbox.no-ip.org/radiant/svn/extensions/x_groggy/x_groggy_extensi
on.rb

If you extend Page, make sure to mention the class name on its own
line in the activate method of your extension. This will force Rails
to load the class. In certain Rails modes (i.e. development,
production, etc), the class will not be found otherwise.

Sean

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs