Add custom items at header menu in ActiveAdmin

后端 未结 5 1663
暖寄归人
暖寄归人 2021-01-08 01:01

I want to add a link like link_to (\"Edit yout profile\", edit_user (current_user)) at header in ActiveAdmin. Is that possible ?!

5条回答
  •  旧巷少年郎
    2021-01-08 01:34

    To me the @kristinalim answer almost work but his custom_path do not work, this give me a error. The next code work for me (I have to define the routes)

    routes = Rails.application.routes.url_helpers
    config.namespace :admin do |admin|
        admin.build_menu do |menu|
            menu.add :label => 'Custom Menu' do |submenu|
                submenu.add label: 'Users', url: routes.admin_users_path
            end
        end
    end
    

提交回复
热议问题