Re: Renaming RESTful actions

Jason Roelofs
Fri, 16 Mar 2007 18:35:54 -0000

On 3/16/07, Jason Roelofs
<jameskilton-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:
>
> I''ve got a RESTful controller that takes in a file upload as the
main
> input into a table. I want to rename POST:resources_url to hit #upload
> instead of #create. Is there something I can specify on map.resources that
> allows me to do this? Or am I stuck generating a URL like
> "/resource/;upload" ?
>
> Jason
>


A little more information, here''s my test (which is failing, difference
being :action => ''create'' is generated, not
''upload''):

    assert_recognizes({:controller => ''taxes'', :action
=> ''upload''}, {:path
=> ''taxes'', :method => :post})

and current routing

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

Jason

--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org