diff options
| author | hukl <hukl@eight.local> | 2009-01-29 21:40:04 +0100 |
|---|---|---|
| committer | hukl <hukl@eight.local> | 2009-01-29 21:40:04 +0100 |
| commit | d4dfdb40329b8e15e6bba022b966984a8a994a87 (patch) | |
| tree | 6e427c2e02308d5b3d554b44d13f2764303da743 /config | |
| parent | b298d3e8eeb10903bd4640dab7c11d0dc1be9d38 (diff) | |
added the content controller which will be responsible for rendering all public pages later on. added a new custom route for the public url schema as well as a functional test which tests the correct mapping of the custom route
Diffstat (limited to 'config')
| -rw-r--r-- | config/routes.rb | 42 |
1 files changed, 4 insertions, 38 deletions
diff --git a/config/routes.rb b/config/routes.rb index 4f3d9d2..cbad5cc 100644 --- a/config/routes.rb +++ b/config/routes.rb | |||
| @@ -1,43 +1,9 @@ | |||
| 1 | ActionController::Routing::Routes.draw do |map| | 1 | ActionController::Routing::Routes.draw do |map| |
| 2 | # The priority is based upon order of creation: first created -> highest priority. | ||
| 3 | |||
| 4 | # Sample of regular route: | ||
| 5 | # map.connect 'products/:id', :controller => 'catalog', :action => 'view' | ||
| 6 | # Keep in mind you can assign values other than :controller and :action | ||
| 7 | |||
| 8 | # Sample of named route: | ||
| 9 | # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase' | ||
| 10 | # This route can be invoked with purchase_url(:id => product.id) | ||
| 11 | |||
| 12 | # Sample resource route (maps HTTP verbs to controller actions automatically): | ||
| 13 | # map.resources :products | ||
| 14 | |||
| 15 | # Sample resource route with options: | ||
| 16 | # map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get } | ||
| 17 | |||
| 18 | # Sample resource route with sub-resources: | ||
| 19 | # map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller | ||
| 20 | 2 | ||
| 21 | # Sample resource route with more complex sub-resources | 3 | map.connect ':language/*pagepath', |
| 22 | # map.resources :products do |products| | 4 | :controller => 'content', :action => 'render_page', |
| 23 | # products.resources :comments | 5 | :requirements => {:language => /\w{2}/} |
| 24 | # products.resources :sales, :collection => { :recent => :get } | 6 | |
| 25 | # end | ||
| 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 => "welcome" | ||
| 35 | |||
| 36 | # See how all your routes lay out with "rake routes" | ||
| 37 | |||
| 38 | # Install the default routes as the lowest priority. | ||
| 39 | # Note: These default routes make all actions in every controller accessible via GET requests. You should | ||
| 40 | # consider removing the them or commenting them out if you're using named routes and resources. | ||
| 41 | map.connect ':controller/:action/:id' | 7 | map.connect ':controller/:action/:id' |
| 42 | map.connect ':controller/:action/:id.:format' | 8 | map.connect ':controller/:action/:id.:format' |
| 43 | end | 9 | end |
