On Oct 31, 2:14 am, Alexandre Conrad <[email protected]>
wrote:
> I would make sure a site and a subsite is a "resource" in Routes.
> RESTful really means that you are using the verbs available in HTTP,
> that is, GET, POST, UPDATE, DELETE without wasting name spaces like
> addsite, delsite, etc., in your URL. RESTful doesn't necessarily mean
> that you must *not* use a query in the URL (like ?site_id=1).
>
> So, for your sites, I would have the following CRUD:
> Create: /admin/site/ (POST)
> Read: /admin/site/id (GET)
> Update: /admin/site/id (PUT)
> Delete: /admin/site/id (DELETE)
>
> Meaning that for your subsites, you could have the following CRUD:
>
> Create: /admin/subsite (POST) (where parent ID and any other info
> would be in the POST body)
> Read: /admin/subsite/id (GET)
> Update: /admin/subsite/id (PUT)
> Delete: /admin/subsite/id (DELETE)

I looked at this and the same real issue persists with CRUD/Restful.
My terminology was wrong - this is for a client facing application
where I wanted clean URLs.

How does one signify a subsite is being added to a site?  The only way
I can see it being done is adding another route.

With the default routes,
/admin/subsite/1
would indicate that you are editing subsite 1, not adding subsite to
site 1

It seems no matter what I come up with, I'm having to alter routes to
handle things and it just seemed like I was overlooking something.
I've got workarounds, but, I was just curious how other people have
handled similar situations.

Having clean urls just seems nicer, but, I think in this case I am
relegated to using ?site_id=1. If I find a better way, I can always
rewrite that portion.

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss?hl=en.

Reply via email to