The Rails Admin Magic Nav generator, replaces Rails Admin's default navigation with a navigation that can be customized by the developer.
By configuring the config/rails_admin/magic_nav.yml
file within your application, the navigation can be controlled.
Under the the appropriate section, add:
name: "Section Name"
links:
- []
Add the following under your section:
name: "Section Name"
links:
- ["Link to list of Users", "user"]
- ["Link to list of Subscribers", "subscriber"]
name: "Section Name"
pages:
- name: "Products"
links:
- ["Add/Edit", "/product_service?model_name=product_service&scope=products"]
Replace your link with something similar to the following:
name: "Products"
links:
- ["Product A", "{{FIND}}|product|{{HAS_SLUG}}|slug-of-product-a"]
Find all intro_blocks
that belong to the page_conatiner
of slug what-we-do
name: "Products"
links:
- ["Intro blocks", "{{FIND}}|intro_blocks|{{BELONGS_TO}}|page_container:what-we-do"]
Set magicNav.active = false
in app/assets/javascripts/rails_admin/custom/ui.js
Add this line to your application's Gemfile:
gem 'rails_admin_magic_nav', :git => 'https://github.com/hardhatdigital/rails_admin-magic_nav'
And then execute:
$ bundle
Run the generator command:
rails g rails_admin_magic_nav
Add the following to your routes file:
get 'magic_nav' => 'rails_admin/magic_nav#index'
Contribution directions go here.
The gem is available as open source under the terms of the MIT License.