Jaiesh_bhai
Jaiesh_bhai

Reputation: 1814

Menu Items in ActiveAdmin

I need to figure out a way to change all the menu item urls in Active Admin. It seems that the rest of active admin correctly links to [app]/admin/[final link], however the menu items in Active admin simply link to /admin/[final link]. I cannot figure out how to change the url's for the menu items in order to follow the same convention as the rest of activeAdmin i.e [app]/admin/[final link].

Changing the scope/namelink in routes does not work.

Upvotes: 0

Views: 1265

Answers (2)

Salma Gomaa
Salma Gomaa

Reputation: 1112

Also you can pass proc to menu url

ActiveAdmin.register Post do
      menu url: proc{ admin_posts_path }
   end

Reference: https://www.titanwolf.org/Network/q/8d3e9507-f612-4b42-a060-09e9aafebf0b/y

Upvotes: 0

Jaiesh_bhai
Jaiesh_bhai

Reputation: 1814

After spending some time on this, I think I have found a way to change the menu items urls. You can go into the resource file under app/admin in your project and add this... Lets say the menu item is for www.home.com/app/admin/posts

ActiveAdmin.register Post do
    menu :url => "/app/admin/posts" 
end

Upvotes: 1

Related Questions