Add custom items at header menu in ActiveAdmin

后端 未结 5 1660
暖寄归人
暖寄归人 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条回答
  •  旧时难觅i
    2021-01-08 01:34

    If you're using a later version of ActiveAdmin that has the capability for custom pages, you can do the following:

     ActiveAdmin.register_page "Store Admin" do
       controller do
         define_method(:index) do
           redirect_to "/store/admin"
         end
       end
     end
    

    This overrides the index action of the PageController which normally just renders the page, but you can instead have it redirect to wherever you want to go, such as edit_user_path

提交回复
热议问题