Re: Routes: How would default routes be defined manually?

bourne
Sun, 19 Dec 2010 14:42:28 -0000

No, I just failed on copy/paste and lost the end in the original post when
removing the up-route :/

  resources :priorities do
    member do
      get ''up''
      get ''add''
    end

    collection do

    end
  end

rake routes (complete)
  up_priority GET    /priorities/:id/up(.:format)
{:controller=>"priorities", :action=>"up"}
 add_priority GET    /priorities/:id/add(.:format)
{:controller=>"priorities", :action=>"add"}
   priorities GET    /priorities(.:format)
{:controller=>"priorities", :action=>"index"}
   priorities POST   /priorities(.:format)
{:controller=>"priorities", :action=>"create"}
 new_priority GET    /priorities/new(.:format)
{:controller=>"priorities", :action=>"new"}
edit_priority GET    /priorities/:id/edit(.:format)
{:controller=>"priorities", :action=>"edit"}
     priority GET    /priorities/:id(.:format)
{:controller=>"priorities", :action=>"show"}
     priority PUT    /priorities/:id(.:format)
{:controller=>"priorities", :action=>"update"}
     priority DELETE /priorities/:id(.:format)
{:controller=>"priorities", :action=>"destroy"}
         root        /(.:format)