Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 4226

Show
Ignore:
Timestamp:
04/18/06 05:18:05 (2 years ago)
Author:
david
Message:

Named routes didnt make sense for all

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/simply_restful/lib/simply_restful/routes.rb

    r4223 r4226  
    1717 
    1818        with_options :controller => collection do |map| 
    19           map.named_route(collection,         collection_path,              :action => "index",  :require => { :method => :get }) 
    20           map.named_route("create_#{entity}", collection_path,              :action => "create", :require => { :method => :post }) 
    21           map.named_route("new_#{entity}",    "#{collection_path}/builder", :action => "new") 
     19          map.named_route(collection, collection_path, :action => "index", :require => { :method => :get }) 
     20          map.connect(collection_path, :action => "create", :require => { :method => :post }) 
    2221 
    23           map.named_route(entity,             entity_path,                  :action => "show",   :require => { :method => :get }) 
    24           map.named_route("delete_#{entity}", entity_path,                  :action => "delete", :require => { :method => :delete }) 
    25           map.named_route("update_#{entity}", entity_path,                  :action => "update", :require => { :method => :put }) 
    26           map.named_route("edit_#{entity}",   "#{entity_path}/editor",      :action => "edit") 
     22          map.named_route(entity, entity_path, :action => "show",   :require => { :method => :get }) 
     23          map.connect(entity_path, :action => "delete", :require => { :method => :delete }) 
     24          map.connect(entity_path, :action => "update", :require => { :method => :put }) 
     25 
     26          map.named_route("new_#{entity}",  "#{collection_path}/builder", :action => "new") 
     27          map.named_route("edit_#{entity}", "#{entity_path}/editor", :action => "edit") 
    2728        end 
    2829      end