annotate config/routes.rb @ 2:42de15334db1

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