annotate config/routes.rb @ 0:4aa8194a1733

Initial.
author Edho Arief <edho@myconan.net>
date Sun, 26 Aug 2012 10:58:26 -0700
parents
children 42de15334db1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
1 Zeropaste::Application.routes.draw do
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
2 # The priority is based upon order of creation:
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
3 # first created -> highest priority.
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
4
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
5 # Sample of regular route:
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
6 # match 'products/:id' => 'catalog#view'
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
7 # Keep in mind you can assign values other than :controller and :action
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
8
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
9 # Sample of named route:
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
10 # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
11 # This route can be invoked with purchase_url(:id => product.id)
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
12
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
13 # Sample resource route (maps HTTP verbs to controller actions automatically):
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
14 # resources :products
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
15
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
16 # Sample resource route with options:
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
17 # resources :products do
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
18 # member do
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
19 # get 'short'
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
20 # post 'toggle'
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
21 # end
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
22 #
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
23 # collection do
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
24 # get 'sold'
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
25 # end
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
26 # end
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
27
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
28 # Sample resource route with sub-resources:
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
29 # resources :products do
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
30 # resources :comments, :sales
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
31 # resource :seller
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
32 # end
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
33
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
34 # Sample resource route with more complex sub-resources
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
35 # resources :products do
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
36 # resources :comments
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
37 # resources :sales do
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
38 # get 'recent', :on => :collection
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
39 # end
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
40 # end
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
41
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
42 # Sample resource route within a namespace:
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
43 # namespace :admin do
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
44 # # Directs /admin/products/* to Admin::ProductsController
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
45 # # (app/controllers/admin/products_controller.rb)
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
46 # resources :products
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
47 # end
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
48
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
49 # You can have the root of your site routed with "root"
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
50 # just remember to delete public/index.html.
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
51 # root :to => 'welcome#index'
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
52
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
53 # See how all your routes lay out with "rake routes"
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
54
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
55 # This is a legacy wild controller route that's not recommended for RESTful applications.
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
56 # Note: This route will make all actions in every controller accessible via GET requests.
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
57 # match ':controller(/:action(/:id))(.:format)'
4aa8194a1733 Initial.
Edho Arief <edho@myconan.net>
parents:
diff changeset
58 end