KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Generally I have MenuItems model and trying to make '/menu_items(/:id(:/some_action))' URLs looks like '/menu(/:id(:/some_action))' In Rails 2.3.5 it was map.resources :menu_items, :as => :menu, :path_names => { :new => 'add' } Now in Rails 3.0.3 I'm able to handle it using this huge paragraph of code resources :menu_items, :path_names => { :new => 'add' } match 'menu/' => 'menu_items#index', :as => :menu match 'menu/add' => 'menu_items#new', :as => :new_menu match 'menu/:id' => 'menu_items#show', :as => :show_menu match 'menu/:id/edit' => 'menu_items#edit', :as => :edit_menu But it looks incorrect because of huge amount of code. Seems :as works like 2nd Rails' map.some_name now. Any help/suggestions/guides? (Thanks)
Tags (comma-separated)
Save Edits
Cancel