Re: Renaming RESTful actions

Trevor Squires
Sat, 17 Mar 2007 00:22:42 -0000

Hi Jason,

Earlier on you said: Or am I stuck generating a URL like "/
resource/;upload"

Forgive me if I''m being dense, but *why* do you want he default POST
to call a method called update() rather than create()?  It seems to
me that if you want POST /some/url to perform a specific set of
actions, why wouldn''t you just do those actions in *create* rather
than fight the framework?

Or, are you in fact saying that you want to have *two* urls to create
a resource in your :taxes resource collection: one that calls create
() and another that calls upload()?

If so, have you tried:

map.resources :taxes, :collection => {:upload => :post}

However, that most definitely *does* generate a resource url like /
taxes;upload so it may not be what you''re looking for.

Regards,
Trevor

On 16-Mar-07, at 1:11 PM, Jason Roelofs wrote:

> On 3/16/07, François Beausoleil
<francois.beausoleil-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> 2007/3/16, Jason Roelofs
<jameskilton-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:
> > I know that the old routing is still available, I''m trying to
> stay away from
> > it as much as I can. The problem I have with REST right now is
> that there is
> > no "accepted spec" for doing REST, if that makes any sense.
When
> it comes to
> > controllers that are a little more complex than just serving up a
> view to a
> > model, is it ok to drop out of REST? What is the point that a
> site is
> > no-longer RESTful?
>
> You have to be pragmatic.  If the REST philosophy doesn''t fit a
> particular case, well, don''t bother.
>
> Hope that helps !
> --
> François Beausoleil
> http://blog.teksol.info/
> http://piston.rubyforge.org/
>
> It *does* fit. All I''m trying to do is rename the action being
used
> by the POST action (default create, I want to rename it to upload).
> Is this possible?
>
> Jason
>
>
>
> >