1
我正在嘗試提供用戶菜單的方法。作爲原型,我最終在routes.rb中使用了這種代碼。我想知道的是,還有更緊湊的方法來提供相同的效果而不會失去太多的清晰度?Rails-4自定義路由
get('ag',
:action => :ag,
:controller => 'navigation/main_menu')
get('menu/ag',
:action => :ag,
:controller => 'navigation/main_menu')
get('navigation/ag',
:action => :ag,
:controller => 'navigation/main_menu')
get('navigation/ag/journals',
:action => :journals,
:controller => 'navigation/ag/main_menu')
get('ap',
:action => :ap,
:controller => 'navigation/main_menu')
get('menu/ap',
:action => :ap,
:controller => 'navigation/main_menu')
get('navigation/ap',
:action => :ap,
:controller => 'navigation/main_menu')
get('menu/ap/journals',
:action => :journals,
:controller => 'navigation/ap/main_menu')
get('navigation/ap/journals',
:action => :journals,
:controller => 'navigation/ap/main_menu')
get('ar',
:action => :ar,
:controller => 'navigation/main_menu')
get('menu/ar',
:action => :ar,
:controller => 'navigation/main_menu')
get('navigation/ar',
:action => :ar,
:controller => 'navigation/main_menu')
get('menu/ar/journals',
:action => :journals,
:controller => 'navigation/ar/main_menu')
get('navigation/ar/journals',
:action => :journals,
:controller => 'navigation/ar/main_menu')
get('menu/currencies',
:action => :index,
:controller => 'navigation/ag/currencies_menu')