/contentr

Contentr is a Content Management System (CMS) that plugs into any Rails 3.1 application as an engine.

Primary LanguageRubyMIT LicenseMIT

Build Status

WARNING: Under heavy development

I think I should write that this gem is not yet production ready. So you should probably wait a bit if you want to use that.

Contentr - The embeddable CMS Engine

Installation

First add contentr and the edge version of carrierwave to your Gemfile

  gem 'contentr', git: "git://github.com/no-dashes/contentr.git"
  gem 'carrierwave', git: 'git://github.com/jnicklas/carrierwave.git'

Then run the bundle command.

Copy the migrations and run them:

rake contentr_engine:install:migrations db:migrate

After that run the install generator.

rails g contentr:install

In order to use contentr properly you need to override two methods in your ApplicationController:

contentr_authorized? and contentr_publisher?

Usage

to make a controller serve the contentr pages:

in routes.rb add

  get '/whatever/path/you/like/*contentr_path' => 'contentr/pages#show', :as => 'contentr'

To use linked pages in a view, add contentr to the corresponding view.

By default, contentr will look for Contentr::LinkedPages with a linked_to attribute like this:

  • controller#action:id if an id is present
  • controller#action
  • controller#*

If you put a contentr "link_key" into your action, the Contentr::LinkedPage with the given link_key will be loaded.

To enable the old-school linked_to behaviour just put a before_filter :contentr into your controller(s).