How to create rails_admin navigation labels without creating empty models?
Asked Answered
U

1

8

In rails admin, you can define a navigation label to a model and its children like so:

# in rails_admin.rb

config.model Order do
  navigation_label 'Orders related'
end

config.model OrderProducts do
  parent Order
end

Is there a way to add labels to the navigation menu without creating models (i.e. just for grouping)?

Unknow answered 25/2, 2013 at 14:43 Comment(0)
S
7

According to the wiki, you can append static links to the navigation like so:

RailsAdmin.config do |config|
  config.navigation_static_links = {
    'Google' => 'http://www.google.com'
  }
end

If you're just looking to group them, you can namespace your models under a module, and then you will see your models grouped under the module name in the navigation. Like so: https://i.sstatic.net/NMJs2.png

RailsAdmin.config do |config|
  config.model 'Spree::Product' do
    ...
  end
end
Stopoff answered 13/1, 2014 at 20:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.