Skip to content
CMS that plugs into any Rails 4 app as an engine.
Ruby HTML JavaScript CSS CoffeeScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
app changing sites
bin initial rewrite
config adds boolean `open_in_new_tab` to nav_point
db/migrate add `template` to contentr pages
lib auto-hide navpoints fo hidden pages.
spec add default locale for area names
vendor/assets/javascripts initial rewrite
.gitignore always include asset id for all uploader fields
.rspec Initial setup rspec and devise
.travis.yml adds travis
Gemfile always include asset id for all uploader fields
MIT-LICENSE Refactor towards a 'headless' milestone
README.markdown some README stuff
Rakefile initial rewrite
contentr.gemspec

README.markdown

contentr Build Status

Requirements

Installation

Add contentr to your Gemfile:

gem 'contentr', github: 'metaminded/contentr'

You'll also want to include contentr in your CSS

@import 'contentr';

And in your application.js

//= require contentr/contentr

Usage

You get three new methods which you should override in your user model:

  • allowed_to_interact_with_contentr?
  • allowed_to_use_paragraphs?
  • contentr_authorized?

The contentr_authorized? method takes two arguments which are type and object. type is a symbol and either :manage or :see. object is the object for which an action needs to be authorized.

The allowed_to_use_paragraphs? method is used to determine if a user is allowed to use paragraphs, depending on multiple arguments. The first argument is area, which is a String with the name of the name of the effected area. If the second parameter subject is set to a paragraph object the method should only determine if a user is allowed to use the specified subject.

Something went wrong with that request. Please try again.