/alchemy_contentable

include cms-capabilities in any model

Primary LanguageRubyMIT LicenseMIT

AlchemyContentable

Use Alchemys element-essences-system in any model you like!

Setup

  1. Setup your Rails app

  2. Install and configure Alchemy CMS

  3. add alchemy_contentable to Gemfile

  4. create a model or extend it with (at least) this fields:

- name:string
- public:boolean
- locked:boolean
- locked_by:boolean
- page_layout
or
- name:string
- add t.contentable to migration
  1. add t.stampable to migration

  2. setup routes for your model:

    resources :elements
    collection do
      post :order
      post :flush
      post :copy_language_tree
      get :switch_language
      get :create_language
      get :link
      get :sort
    end
    member do
      post :unlock
      post :publish
      post :fold
      post :visit
      get :configure
      get :preview
    end
    
  3. include AlchemyContentable::ModelMixin in your model

  4. include AlchemyContentable::ControllerMixin in the model’s controller

  5. include AlchemyContentable::AdminControllerMixin in the model’s admin-controller and inherit from Alchemy::Admin::ResourcesController there

  6. inherit your models controller from Alchemy::BaseController

  7. set up authorization to manage, edit_content and update_content

  8. (optional) mount your controller as a module in alchemy

Issues

  • no multilingual contents (yet)

  • problems with authorization, commented many filters out

  • no clipboard

  • no tests, but rspec setup already…