Search code examples
ruby-on-railsredmineredmine-plugins

How to add an image to the redmine top menu?


I want to put an image on the top menu of my redmine plugin index page.

In init.rb

menu :top_menu, :my_link, {:controller => 'my_controller', :action => 'my_action'}, :caption => "My title" where could a link to any image fit in this syntax?


Solution

  • You'll have to do it with css.

    If you create a menu with:

    menu :top_menu, :my_link, {:controller => 'my_controller', :action => 'my_action'}, :caption => "My title" 
    

    It will be created with the class 'my-link'.

    All you have to do is to define on your css:

    #top-menu a.my-link {     
      padding-left: 20px;
      background-image: url(../images/my-link.png); 
    }