Skip to content
This repository has been archived by the owner on Feb 16, 2021. It is now read-only.

Latest commit

 

History

History
54 lines (36 loc) · 2.16 KB

README.md

File metadata and controls

54 lines (36 loc) · 2.16 KB

Ninetails

Build Status Code Climate Test Coverage

Ninetails is a simple Rails engine to create an API for a content management system to run on. It is designed on the idea of a CMS which is limited in scope in that not all aspects of a page should be editable. Instead, you can define Sections, Elements, and Properties which are editable and can then be loaded in and styled in a reliable manner. It gives you the control to decide exactly what should and what should not be editable in your project.

WARNING: Ninetails is very much a work in progress and is not ready to be fully used yet!

Getting started

Ninetails is a mountable Rails engine, so it needs to be loaded into your app. You app is also where you will define your components which Ninetails should expose. Start by adding it to your Gemfile:

gem "ninetails"

Then you need to mount the engine in config/routes.rb

Rails.application.routes.draw do
  mount Ninetails::Engine, at: "/api"
end

Usage guide

Configuration

By default, Ninetails will force all keys in JSON responses to be camelcase with the first letter lowercase, to conform with JSON standards. If you would prefer the output to be as underscored, you can set this in an initializer:

Ninetails::Config.key_style = :underscore

Testing

You'll need postgresql installed and a test database crated

createdb ninetails_dummy_test

Then you can run the test with rspec

bundle exec rspec