CM Admin
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
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 inside docs-site/docs/ folder will be auto added in CM 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.