Revelry::Content
Revelry::Content is a gem for managing admin-editable content within Rails and React applications.
Installation
Add it to your gemfile:
gem 'revelry_core'
gem 'revelry_content'
and install it:
bundle
rails g revelry:core:install
rails g revelry:content:install
Configuration
The installer makes an initializer in config/initializer.rb
. You can edit it
to customize authentication, authorization or javascript export settings.
Configuring file uploads
Revelry::Content uses carrierwave to store image uploads. You'll want to configure carrierwave appropriately for your app.
Using with React
Adding Editable Sections with React
Revelry::Content is built on React, so you can also directly invoke the React components:
<Rev.Content.EditableText canEdit={true} contentKey="home.headline" />
or
<Rev.Content.EditableImage canEdit={true} contentKey="home.image" />
More details are availble here
There component will present ONLY the content (with no editor chrome) if out of edit mode, and can be clicked to edit in edit mode (see below).
Adding the admin controls
For admin users, you can present edit buttons and an edit mode top bar to allow entry to edit mode and provide feedback during editing:
<Rev.Content.TopBar />
and
<Rev.Content.EditModeButton />
These do not require any props.