Well, the routes file (with the exception of the map.root is generated
by rails. Here it is:
ActionController::Routing::Routes.draw do |map|
map.resources :families
map.resources :users
# The priority is based upon order of creation: first created ->
highest priority.
# Sample of regular route:
# map.connect 'products/:id', :controller => 'catalog', :action =>
'view'
# Keep in mind you can assign values other than :controller
and :action
# Sample of named route:
# map.purchase 'products/:id/purchase', :controller =>
'catalog', :action => 'purchase'
# This route can be invoked with purchase_url(:id => product.id)
# Sample resource route with options:
# map.resources :products, :member => { :short => :get, :toggle
=> :post }, :collection => { :sold => :get }
# Sample resource route with sub-resources:
# map.resources :products, :has_many =>
[ :comments, :sales ], :has_one => :seller
# Sample resource route within a namespace:
# map.namespace :admin do |admin|
# # Directs /admin/products/* to Admin::ProductsController (app/
controllers/admin/products_controller.rb)
# admin.resources :products
# end
# You can have the root of your site routed with map.root -- just
remember to delete public/index.html.
map.root :controller => "users"
# See how all your routes lay out with "rake routes"
# Install the default routes as the lowest priority.
map.connect ':controller/:action/:id'
map.connect ':controller/:action/:id.:format'
end
When I do a rake routes I get:
families GET /families
{:controller=>"families", :action=>"index"}
formatted_families GET /families.:format
{:controller=>"families", :action=>"index"}
POST /families
{:controller=>"families", :action=>"create"}
POST /families.:format
{:controller=>"families", :action=>"create"}
new_family GET /families/new
{:controller=>"families", :action=>"new"}
formatted_new_family GET /families/new.:format
{:controller=>"families", :action=>"new"}
edit_family GET /families/:id/edit
{:controller=>"families", :action=>"edit"}
formatted_edit_family GET /families/:id/edit.:format
{:controller=>"families", :action=>"edit"}
family GET /families/:id
{:controller=>"families", :action=>"show"}
formatted_family GET /families/:id.:format
{:controller=>"families", :action=>"show"}
PUT /families/:id
{:controller=>"families", :action=>"update"}
PUT /families/:id.:format
{:controller=>"families", :action=>"update"}
DELETE /families/:id
{:controller=>"families", :action=>"destroy"}
DELETE /families/:id.:format
{:controller=>"families", :action=>"destroy"}
users GET /users
{:controller=>"users", :action=>"index"}
formatted_users GET /users.:format
{:controller=>"users", :action=>"index"}
POST /users
{:controller=>"users", :action=>"create"}
POST /users.:format
{:controller=>"users", :action=>"create"}
new_user GET /users/new
{:controller=>"users", :action=>"new"}
formatted_new_user GET /users/new.:format
{:controller=>"users", :action=>"new"}
edit_user GET /users/:id/edit
{:controller=>"users", :action=>"edit"}
formatted_edit_user GET /users/:id/edit.:format
{:controller=>"users", :action=>"edit"}
user GET /users/:id
{:controller=>"users", :action=>"show"}
formatted_user GET /users/:id.:format
{:controller=>"users", :action=>"show"}
PUT /users/:id
{:controller=>"users", :action=>"update"}
PUT /users/:id.:format
{:controller=>"users", :action=>"update"}
DELETE /users/:id
{:controller=>"users", :action=>"destroy"}
DELETE /users/:id.:format
{:controller=>"users", :action=>"destroy"}
root /
{:controller=>"users", :action=>"index"}
/:controller/:action/:id
/:controller/:action/:id.:format
Boy, I wish there was some documentation of what's going on here...
Thanks for any help
Dick