Feature #6426

MenuManager::MenuItem should support a named route as a url

Added by Eric Davis about 8 years ago. Updated almost 4 years ago.

Status:ClosedStart date:2010-09-17
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Code cleanup/refactoring
Target version:3.0.0
Resolution:Fixed

Description

Instead of having to always use the controller/action/id hash for a menu item, a resource route should also be allowed.

# init.rb for menus
# Old way
{ :controller => 'contracts', :action => 'show', :id => contract.id, :project_id => project}
# New way
contract_path(project, contract)

Might need to add some more modules/helpers into Redmine::Plugin or MenuItem.

/home/edavis/dev/redmine/redmine-core/vendor/plugins/redmine_contracts/init.rb:37
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/associations/association_collection.rb:369:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/associations/association_proxy.rb:215:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:2199:in `inject'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/associations/association_proxy.rb:215:in `each'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/associations/association_proxy.rb:215:in `inject'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/associations/association_proxy.rb:215:in `send'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/associations/association_proxy.rb:215:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/associations/association_collection.rb:369:in `method_missing'
/home/edavis/dev/redmine/redmine-core/vendor/plugins/redmine_contracts/init.rb:33
/home/edavis/dev/redmine/redmine-core/lib/redmine/menu_manager.rb:223:in `call'
/home/edavis/dev/redmine/redmine-core/lib/redmine/menu_manager.rb:223:in `render_unattached_children_menu'

Associated revisions

Revision 13765
Added by Jean-Philippe Lang almost 4 years ago

Support for named route in project menu and a new :permission option (#6426).

History

#1 Updated by Eric Davis almost 8 years ago

  • Assignee deleted (Eric Davis)

#2 Updated by Jean-Philippe Lang almost 4 years ago

  • Tracker changed from Defect to Feature
  • Subject changed from MenuManager::MenuItem should support a resource route as a url to MenuManager::MenuItem should support a named route as a url
  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang
  • Target version changed from Unplanned to 3.0.0
  • Resolution set to Fixed

Also available in: Atom PDF