changelog shortlog tags changeset manifest revisions annotate raw

config/routes.rb

changeset 9: 5cf82beef889
parent:eddc0740bd25
child:c7be8325050f
author: moriq@moriq.com
date: Mon Mar 10 03:22:11 2008 +0900 (16 years ago)
permissions: -rw-r--r--
description: add scaffold product.
1ActionController::Routing::Routes.draw do |map|
2 map.resources :products
3
4 map.resources :users
5
6 map.resource :session
7
8 # The priority is based upon order of creation: first created -> highest priority.
9
10 # Sample of regular route:
11 # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
12 # Keep in mind you can assign values other than :controller and :action
13
14 # Sample of named route:
15 # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
16 # This route can be invoked with purchase_url(:id => product.id)
17
18 # Sample resource route (maps HTTP verbs to controller actions automatically):
19 # map.resources :products
20
21 # Sample resource route with options:
22 # map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }
23
24 # Sample resource route with sub-resources:
25 # map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller
26
27 # Sample resource route within a namespace:
28 # map.namespace :admin do |admin|
29 # # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb)
30 # admin.resources :products
31 # end
32
33 # You can have the root of your site routed with map.root -- just remember to delete public/index.html.
34 map.root :controller => "home"
35
36 # See how all your routes lay out with "rake routes"
37
38 # Install the default routes as the lowest priority.
39 map.connect ':controller/:action/:id'
40 map.connect ':controller/:action/:id.:format'
41end