[v4.0] Registering Content Types

bburton edited this page Sep 28, 2014 · 2 revisions
Clone this wiki locally

Registering Content Types

Content blocks no longer need to have a separate registration in the database to appear in menus.

Defining a new content model should be sufficient to have it appear in the content library. To specify which module it should appear in, you can configure it like so:

class Widget < ActiveRecord::Base
  acts_as_content_block
  content_module :acme
end

The content_types and content_type_groups tables have been removed as they are no longer necessary. If you don't want a block to appear in the menus, you can specify this via:

class Widget < ActiveRecord::Base
  acts_as_content_block content_module: false
end