8

在 rails admin 中,您可以为模型及其子项定义导航标签,如下所示:

# in rails_admin.rb

config.model Order do
  navigation_label 'Orders related'
end

config.model OrderProducts do
  parent Order
end

有没有办法在不创建模型的情况下向导航菜单添加标签(即仅用于分组)?

4

1 回答 1

7

根据wiki,您可以将静态链接附加到导航,如下所示:

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

如果您只是想对它们进行分组,您可以在模块下命名您的模型,然后您将在导航中看到您的模型在模块名称下分组。像这样:http: //i.imgur.com/kxtgNqx.png

RailsAdmin.config do |config|
  config.model 'Spree::Product' do
    ...
  end
end
于 2014-01-13T20:59:05.433 回答