Dhatu
Dhatu is a simple CMS for your website Dhatu (Sanskrit word for elements). This plugin will add all the basic elements required for a website. e.g: services, products, news & events, testimonials etc
Dhatu requies kuppayam, pattana and usman
Installation
Add this line to your application's Gemfile:
gem 'dhatu'
And then execute:
$ bundle
Or install it yourself as:
$ gem install dhatu
Usage
Installing the kuppayam, pattana & usman migrations
Usman uses kuppayam skins and hence it requires the basic migrations from kuppayam to run Run the below command to copy the migrations from the kuppayam engine.
$ bundle exec rails railties:install:migrations
This will copy migrations from kuppayam, pattana and usman engines which will have migrations to create images, documents, countries, regions, cities, users, features and permissions respectively.
Mount the engine
Mount dhatu engine in your application routes.rb
mount Dhatu::Engine => "/"
open browser and go to /sign_in url
Railties order
Specify the railties order if required in main application.rb
`` config.autoload_paths << "app/services" config.railties_order = [:main_app, Dhatu::Engine, Usman::Engine, Pattana::Engine, Kuppayam::Engine, :all]
# Seeding Data
run rake task for loading dummy data for users and features to start with.
```bash
$ bundle exec rails usman:import:dummy:all verbose=false
$ bundle exec rails pattana:import:dummy:all verbose=false
["users", "features", "permissions", "roles"]
You could also do it individually but the above command will run in the following order - users, features, permissions, roles. This order is important as features need users to be imported first.
$ bundle exec rails usman:import:dummy:users verbose=false
$ bundle exec rails usman:import:dummy:features verbose=false
$ bundle exec rails usman:import:dummy:permissions verbose=false
$ bundle exec rails usman:import:dummy:roles verbose=false
$ bundle exec rails pattana:import:dummy:countries verbose=false
$ bundle exec rails pattana:import:dummy:regions verbose=false
$ bundle exec rails pattana:import:dummy:cities verbose=false
Import Data
You could override the seed files with your data. just create db/import_data in your project folder and create the following files filled with your data in the required format (checkout the dummy csvs in usman db/import_data/dummy/features.csv) for the columns required
for e.g:
create users.csv in db/import_data/ foler and fill data in it and run
$ bundle exec rails usman:import:users verbose=false
Testing the gem
cd spec/dummy rails db:create db:migrate
rails s -p
Running rspec
rails db:create db:migrate RAILS_ENV
run rspec from the rails root folder and not from dummy folder as spec helper has been linked to dummy.
rspec
Contributing
Visit - https://github.com/right-solutions/usman Feel free to submit a patch
License
The gem is available as open source under the terms of the MIT License.