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