Add custom items at header menu in ActiveAdmin

后端 未结 5 1658
暖寄归人
暖寄归人 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:29

    according to the post that @phoet mentioned, (https://stackoverflow.com/a/7218598/445908) try this code:

    module ActiveAdmin
      module Views
        class HeaderRenderer
          def to_html
            title + global_navigation + profile_link + utility_navigation
          end
    
          def profile_link
            link_to ("Edit yout profile", edit_user (current_user))
          end
        end
      end
    end
    

提交回复
热议问题