I guess there isn't much information on this, but you might want to
look at well written source code for inspiration.

>From my experience (which isn't much), your routing table should look
something like:

map.resources :shops, :has_many => [:products], :shallow => true

map.resources :products, :controller => "manage_products"

This means that you will have 3 controllers; one for shops and two for
products.

One product controller will be used for showing and will be accessed
as a nested resource of shops. The other will act as a stand alone
resource, but will be password protected.

This may not be the best design for your needs, but I hope you can
improve on it.

On Apr 8, 8:23 pm, Ar Chron <[email protected]> wrote:
> view one = show, view many = index, whether its the admin viewing
> products, or a user viewing products, there's just one HTTP verb and url
> pattern in use...
> /products/ as a GET request.
>
> If it were /products/ as a POST request, it better be accompanied by
> sufficient parameters to define the new product resource, since that's a
> RESTful create request pattern.
>
> The basis of REST is the four HTTP 'verbs' GET, PUT, POST, DELETE.
>
> Rails scaffolding builds REST out with 'standard' methods of:
>
> index, show, new, edit, create, update, destroy
>
> which pair a url pattern with one of the four HTTP request types
>
> index:
> /plural_resource_name/ + GET - return a collection of the desired
> resource
>
> create:
> /plural_resource_name/ + POST - create a new instance of the resource
>
> new:
> /plural_resource_name/new + GET - return a new instance of the resource
>
> show:
> /plural_resource_name/id + GET - return a single instance of the
> resource
>
> update:
> /plural_resource_name/id + PUT - update a single instance of the
> resource
>
> destroy:
> /plural_resource_name/id + DELETE - destroy a single instance of the
> resource
>
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to