ezdash - D4uS1/ez-on-rails GitHub Wiki

ezdash - generator

If your application is modularized using namespaces you can use this generator to create dashbords holding tiles with links to the actions in those namepsaces of your application.

rails generate ez_on_rails:ezdash Managemet

This will provide a dashboard that is accessible over https://your-application.com/management/dashboard. The dashboard holds tiles having links to actions or resources that were found in the management namespace.

The dashboards is rendered using a dash info method given in the generated helper file.

The concept of using dashboards is explained on the dashboard concept page. There you can read about the possibility to change the behavior and appearance of the dashboards.

The generated dashboard is per default only accessible for super admins. This is because the generator appends the restriction to the db/seeds.rb file. To change this behavior have a look at the permission system concept and change the generated restriction in the seeds to your needs.

Options

The only parameter you must pass is the name of the namespace.

The following steps are executed by the generator

1. Create the controller

  • The controller is located in app/controllers//dashboard_controller.rb

2. Create the view

  • The view is located in app/views//dashboard/index.html.slim
  • The view is written using slim

3. Create the helper

  • The helper holding the dash info to customize the dashboard is located in app/helpers//dashboard_helper.rb

4. Create the locale files

  • The files to use the i18n translations are located in the config/locales directory.

5. Create specs

  • The spec to test your dashboard is located in spec/requests//dashboard_spec.rb

6. Add access restriction to seeds

  • Appends the default restriction to be only able to use the dashboard as super admin to the db/seeds.rb file

7. Create route

  • Appeds the route to acces the dashboard to the config/routes.rb file
⚠️ **GitHub.com Fallback** ⚠️