Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create rails_admin navigation labels without creating empty models?

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)?

like image 749
Samuel G. P. Avatar asked Feb 25 '13 14:02

Samuel G. P.


1 Answers

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: http://i.imgur.com/kxtgNqx.png

RailsAdmin.config do |config|
  config.model 'Spree::Product' do
    ...
  end
end
like image 62
RubeOnRails Avatar answered Nov 04 '22 00:11

RubeOnRails