Closed domachine closed 11 years ago
https://github.com/component/model/pull/21
i had to monkey patch .url()
to change urls :(
we need to pluralize then :( looks brutal without, but pluralization is so leaky and lame too, unless we take the simple route and just append s
, otherwise you have to specify
yeah i like it. had the pluralization always in mind. we always used the plural as model name which was a quick workaround.
I disagree with any auto inflections, I've always hated that in rails (and now json api, etc, it's like a virus). Appending 's' is going to cause a lot of head scratching, I fear. Also it's going to break existing code, forcing people to either Model.base = '/model'
to get around it or change their server routes. Much rather see the default be the singular model name and if you want pluralization then explicitly do Person.base = '/people'
or whatever.
singular makes no sense void of something (silly) like /user/list
/user/all
etc, inflection definitely sucks though I'll give you that. I think appending s
is ok, not like it's hard to inspect what the request generated is, as long as we provide .base('/route')
or something, props usually are not great for public api .base
is technically private
It's just what conventions we're used to. I see no problem with POST /user
, GET /user
. But whatever - as long as there's a public way of overriding the base path, I'll probably explicitly set that each time anyway.
@domachine, yes and that particular aspect of REST (actually just a convention started by Rails AFAIK) is what I'm saying is not something I'm interested in spreading further :) But as I said I'm fine with whatever as long as there's an override.
i think the /all suffix is ugly and not necessary.