سؤال

I am trying to add a global navigation menu item to my Active Admin installation (next to the 'Dashboard' nav button). Active Admin says this is possible on their site but they do not have any documentation about how to achieve it. Does anyone know how to do this?

EDIT: Sorry, I should have been more clear. I want to add a link to the global navigation that consists of an arbitrary text/link pair. IE, if I wanted to add a link to http://google.com with text "Google" in the global navigation of active admin, how would I accomplish that?

هل كانت مفيدة؟

المحلول

ActiveAdmin.register_page "Google" do
  menu :priority => 1, :label => 'Google' , :url => 'http://google.com'
 end

نصائح أخرى

Only relevant for ActiveAdmin versions <= 0.4 :: Reading the source of the TabbedNavigation class, there does not seem to be an easy way. If relying on javascript and jquery does not bother you, you could place something similar to this in your application.js:

$(document).ready(function(){
    $('#dashboard').parent().append('<li><a href="http://www.google.com/">Google</a></li>');
});

Where do they claim that this would be possible?

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top