URLs and the request method determine which action rails "magically" takes.

GET    /items        #=> renders index view
POST   /items        #=> creates record from params

GET    /items/1      #=> renders show view
PUT    /items/1      #=> updates record from params
DELETE /items/1      #=> destroys record



On Oct 27, 2010, at 4:17 AM, אריה גלזר wrote:

> Rails uses a RESTful API - each action is identified by the type of request. 
> GET for reading  message
> POST for posting and editing
> DELETE for deleting
> 
> and so forth. (not a rails dev so forgive me if there are some mistakes, but 
> the concept is right).
> 
> On Wed, Oct 27, 2010 at 11:57 AM, Oskar Krawczyk <[email protected]> 
> wrote:
> It's a Ruby application. I don't know much about Ruby but apparently they 
> utilize this kind of methods quite often.
> 
> 
> ___
> 
> Oskar Krawczyk
> http://nouincolor.com
> 
> 
> On Wed, Oct 27, 2010 at 11:30 AM, Rolf -nl <[email protected]> wrote:
> Oskar, any idea why they explicitly use delete?
> 
> On Oct 27, 9:47 am, Arian <[email protected]> wrote:
> > It is a bit confusing, but delete and put are emulated by default,
> > because not every browser/server can handle them (inspect the post/get
> > data and you'll see it). If you set the emulation option to false, it
> > should do a real delete request.
> >
> > There is already some info about 
> > ithttp://mootools.net/docs/core/Request/Request#Request:send
> > but I added an extra line in the docs about this recently, for the
> > next release/docs update.
> >
> > On Oct 26, 4:17 pm, Oskar Krawczyk <[email protected]> wrote:
> >
> >
> >
> > > You don't say :-)
> >
> > > On 2010-10-26, at 16:14, אריה גלזר wrote:
> >
> > > > open a lighthouse ticket
> >
> > > > On Tue, Oct 26, 2010 at 4:05 PM, Oskar Krawczyk 
> > > > <[email protected]> wrote:
> > > > Ok, seems the documentation misled me on this one. Just skimmed
> > > > through mootools-core and noticed this:
> >
> > > > var methods = {};
> > > > ['get', 'post', 'put', 'delete', 'GET', 'POST', 'PUT',
> > > > 'DELETE'].each(function(method){
> > > >        methods[method] = function(data){
> > > >                return this.send({
> > > >                        data: data,
> > > >                        method: method
> > > >                });
> > > >        };
> > > > });
> >
> > > > On Oct 26, 3:51 pm, Oskar Krawczyk <[email protected]> wrote:
> > > > > It seems the Request class is fixed to POST and GET methods - is this 
> > > > > the case? Has anyone tried doing a DELETE request? I was just dropped 
> > > > > into a Rails project and it seems they're using DELETE methods all 
> > > > > over the place.
> >
> > > > > O.
> >
> > > > --
> > > > Arieh Glazer
> > > > אריה גלזר
> > > > 052-5348-561
> > > > 5561
> 
> 
> 
> 
> -- 
> Arieh Glazer
> אריה גלזר
> 052-5348-561
> 5561
> 

Reply via email to