CmAdmin
An admin gem for Ruby on Rails application. Get your admin panel setup running quickly.
Installation
Add this line to your application’s Gemfile:
gem 'cm-admin'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install cm-admin
Usage
Install the gem
$ rails g cm_admin:install
Documentation
You can find more detailed documentation here
Demo
For demo check here For demo repo check here
Development
After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
.
Any markdown and ruby file added in docs/
folder will be auto added in yard docs.
Deployment
To release a new version of the Gem you can use Github Actions.
Go to Actions tab in your repository and click on Bump Gem
workflow. You will see Run workflow
button click on it and choose Bump Type
, then click Run Workflow
and it will bump the version of the gem and push the changes to the repository.
Integration Guidelines
To ensure smooth integration of the cm_admin
gem with your Rails application, follow these guidelines:
1. Initializer File Naming
The initializer must be named zcm_admin.rb
.
The leading z
ensures that the file is loaded last in the Rails boot sequence.
2. Enum Declaration Order
In models using a CmAdmin concern, always declare enums before including the concern.
This ensures enum methods are defined before the concern relies on them.
Example:
class Post < ApplicationRecord
enum :status, %i[draft approved rejected]
include CmAdmin::Post
end
Contributing
Bug reports and pull requests are welcome on GitHub.
License
The gem is available as open source under the terms of the MIT License.