I'm creating a Redmine plugin with a menu tab. Follow the guide
http://www.redmine.org/projects/redmine/wiki/Plugin_Tutorial
I can add a menu tab in file init.rb as below:
permission :polls, { :polls => [:index, :vote] }, :public => true
menu :project_menu, :polls, { :controller => 'polls', :action => 'index' }, :caption => 'Polls', :after => :activity, :param => :project_id
The menu tab is OK for PollsController.
But I create a new controller (for example, ArticlesController) in the same plugin. There's a link in polls#index to go to articles#new. But articles#new don't appear in the menu, it appear as I didn't create menu. How can I use the 'Polls' menu tab for ArticlesController.
I tried:
class ArticlesController < ApplicationController
menu_item :pivot_table
....
end
and
permission :polls, { :polls => [:index, :vote] }, :public => true
permission :polls, { :articles => [:index, :vote] }, :public => true
menu :project_menu, :polls, { :controller => 'polls', :action => 'index' }, :caption => 'Polls', :after => :activity, :param => :project_id
but no luck.
Here my routes.rb:
RedmineApp::Application.routes.draw do
resources :projects do
resources :polls, :only => [:index]
resources :articles, :only => [:new, :create]
end
resources :articles, :except => [:show]
end
Pleae help me. My redmine version is 2.3.2. Thank you.