This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
MIT-LICENSE | Thu Jun 12 11:37:57 -0700 2008 | |
| |
README.markdown | Wed Sep 03 08:32:16 -0700 2008 | |
| |
Rakefile | Thu Jun 12 11:37:57 -0700 2008 | |
| |
init.rb | Thu Jun 12 11:37:57 -0700 2008 | |
| |
lib/ | Thu Jun 12 11:37:57 -0700 2008 | |
| |
test/ | Thu Jun 12 11:37:57 -0700 2008 |
README.markdown
SelectiveMapper
Selectively map resource routes to allow cleaner nesting of resources without having to specify redundant ids for parent resources.
IMPORTANT
A patch I submitted to edge rails recently has been accepted.
The update adds a :shallow option to the resources method eliminating my original need for this plugin.
This reduces the example from this document from ...
map.resources :companies do |company|
company.resources :people, :only => [ :collection, :new ]
end
map.resources :people, :except => [ :collection, :new ]
... to ...
map.resources :companies, :shallow => true do |company|
company.resources :people
end
... or ...
map.resources :companies, :shallow => true, :has_many => :people
Example
map.resources :companies do |company|
company.resources :people, :only => [ :collection, :new ]
end
map.resources :people, :except => [ :collection, :new ]
Results in...
companies GET /companies {:controller=>"companies", :action=>"index"}
formatted_companies GET /companies.:format {:controller=>"companies", :action=>"index"}
POST /companies {:controller=>"companies", :action=>"create"}
POST /companies.:format {:controller=>"companies", :action=>"create"}
new_company GET /companies/new {:controller=>"companies", :action=>"new"}
formatted_new_company GET /companies/new.:format {:controller=>"companies", :action=>"new"}
edit_company GET /companies/:id/edit {:controller=>"companies", :action=>"edit"}
formatted_edit_company GET /companies/:id/edit.:format {:controller=>"companies", :action=>"edit"}
company GET /companies/:id {:controller=>"companies", :action=>"show"}
formatted_company GET /companies/:id.:format {:controller=>"companies", :action=>"show"}
PUT /companies/:id {:controller=>"companies", :action=>"update"}
PUT /companies/:id.:format {:controller=>"companies", :action=>"update"}
DELETE /companies/:id {:controller=>"companies", :action=>"destroy"}
DELETE /companies/:id.:format {:controller=>"companies", :action=>"destroy"}
company_people GET /companies/:company_id/people {:controller=>"people", :action=>"index"}
formatted_company_people GET /companies/:company_id/people.:format {:controller=>"people", :action=>"index"}
POST /companies/:company_id/people {:controller=>"people", :action=>"create"}
POST /companies/:company_id/people.:format {:controller=>"people", :action=>"create"}
new_company_person GET /companies/:company_id/people/new {:controller=>"people", :action=>"new"}
formatted_new_company_person GET /companies/:company_id/people/new.:format {:controller=>"people", :action=>"new"}
edit_person GET /people/:id/edit {:controller=>"people", :action=>"edit"}
formatted_edit_person GET /people/:id/edit.:format {:controller=>"people", :action=>"edit"}
person GET /people/:id {:controller=>"people", :action=>"show"}
formatted_person GET /people/:id.:format {:controller=>"people", :action=>"show"}
PUT /people/:id {:controller=>"people", :action=>"update"}
PUT /people/:id.:format {:controller=>"people", :action=>"update"}
DELETE /people/:id {:controller=>"people", :action=>"destroy"}
DELETE /people/:id.:format {:controller=>"people", :action=>"destroy"}
Legal
Author: S. Brent Faulkner brentf@unwwwired.net
License: Copyright © 2008 unwwwired.net, released under the MIT license







