0.0
No commit activity in last 3 years
No release in over 3 years
Mongoid Scribe
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
~> 0.5.1
~> 0.9.12.6
>= 0
~> 3.0.0

Runtime

>= 4.0.0
>= 4.0.0
 Project Readme

Mongoid Scribe

Build Status Code Climate

Mongoid Scribe is a Rails Engine that provides a DSL for setting up simple admin interfaces to edit MongoDB documents. No configuration is required in order to get a basic form, however you can override any form you want to provide a more custom and usable interface.

Generator

To generate an initializer:

bundle exec rails generate mongoid_scribe:install

Configuration

Mongoid::Scribe.configure do

  authenticate_with :admin_required
  
  mount_at "/admin/documents"
  
  resources exclude: [:user_roles]

  form_configuration_for User do
  	field :first_name
    field :last_name
    field :favorite_color, values: User::COLORS
    field :email, type: :email
    field :home_city_id
    field :visitied_city_ids: values: ->(user) { user.visited_cities }, label: :name, value: :id
  end

  index_configuration_for User do
    column :first_name
    column :last_Name
    column :email
    column :city, value: ->(user) { user.city.name }
  end

end

Usage

In your application visit: /documents

Options

authenticate_with: Provide a controller filter for granting / denying access
form_configuration_for Class: Allows you to specify the fields that you want on the form for the specified class
index_configuration_for Class: Allows you to specify the columns that are displayed on the index page mount_at: Endpoint where editor is mounted (default is /documents)
resources: Include or exclude specific models from the editor interface

Notes

In development mode set preload_models: true

Styled using Base