All, I apologize if this question has been asked before but I was unable to find a search feature in the mailing list archives... I''m a first time Railer looking to implement a REST (http://rest.blueoxen.net/cgi-bin/wiki.pl?ShortSummaryOfRest) application using Rails. To do this I would like to use HTTP PUT/DELETE for doing insert/delete instead of passing a method name on the query string. Has anyone implemented a solution like this using Rails? If not can anyone tell me if the current architecture of Rails supports this shift? Thanks, Josh
You can get the action using @request.method so within your action you could do: case @request.method when :post ... when :put .... when :delete .... when :get .... end I have never tried this though. On Wed, 19 Jan 2005 10:31:47 -0800, Josh Knowles <joshknowles-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> All, > > I apologize if this question has been asked before but I was unable to > find a search feature in the mailing list archives... > > I''m a first time Railer looking to implement a REST > (http://rest.blueoxen.net/cgi-bin/wiki.pl?ShortSummaryOfRest) > application using Rails. To do this I would like to use HTTP > PUT/DELETE for doing insert/delete instead of passing a method name on > the query string. > > Has anyone implemented a solution like this using Rails? If not can > anyone tell me if the current architecture of Rails supports this > shift? > > Thanks, > > Josh > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Tobi http://www.hieraki.org - Open source book authoring http://blog.leetsoft.com - Technical weblog
How does this integrate with the current way of going about things with the passing of the action on the query string? On Wed, 19 Jan 2005 17:01:55 -0500, Tobias Luetke <tobias.luetke-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> You can get the action using @request.method > > so within your action you could do: > > case @request.method > when :post > ... > when :put > .... > when :delete > .... > when :get > .... > end > > I have never tried this though. > > On Wed, 19 Jan 2005 10:31:47 -0800, Josh Knowles <joshknowles-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > All, > > > > I apologize if this question has been asked before but I was unable to > > find a search feature in the mailing list archives... > > > > I''m a first time Railer looking to implement a REST > > (http://rest.blueoxen.net/cgi-bin/wiki.pl?ShortSummaryOfRest) > > application using Rails. To do this I would like to use HTTP > > PUT/DELETE for doing insert/delete instead of passing a method name on > > the query string. > > > > Has anyone implemented a solution like this using Rails? If not can > > anyone tell me if the current architecture of Rails supports this > > shift? > > > > Thanks, > > > > Josh > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > -- > Tobi > http://www.hieraki.org - Open source book authoring > http://blog.leetsoft.com - Technical weblog >