Simple question really, how do I invoke a non-GET REST action from a non-browser client, like an e-mail? In our rails 1.1.6 app, we have outbound e-mails that provide the reader several actions they can perform directly from their e-mail reader by clicking the link. Most of these actions would be POST or DELETE verbs. When we migrate to 1.2 and REST how do we implement such links? The syntax for custom actions (e.g. "/projects/1;close") seems close, but does this work for the built-in verbs too? Thanks in advance, Brittain --~--~---------~--~----~------------~-------~--~----~ 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 For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Brittain, Most browsers and other clients (like email) only use the HTML verbs GET and POST. Although, this may be corrected in the future, as XHTML5 fixes some of the problems with HTML4. In order to overcome this problem, Rails uses an overloaded post method for the missing verbs. This means that Rails includes a hidden value in a form indicating the verb (like PUT and DELETE). For example, in your edit form, you will have a field like: <input name ="_method" type="hidden" value="put" /> DELETE follows a similar format. As long as your client is able to submit forms, you should be ok. This URL might be helpful to you: http://www.b-simple.de/documents/download/6 I would also suggest the book RESTful Web Services from O''Reilly. Good luck! On Jul 9, 6:26 am, Brittain <britta1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Simple question really, how do I invoke a non-GETRESTaction from a > non-browser client, like an e-mail? > > In our rails 1.1.6 app, we have outbound e-mails that provide the > reader several actions they can perform directly from their e-mail > reader by clicking the link. Most of these actions would be POST or > DELETE verbs. > > When we migrate to 1.2 andRESThow do we implement such links? The > syntax for custom actions (e.g. "/projects/1;close") seems close, but > does this work for the built-in verbs too? > > Thanks in advance, Brittain--~--~---------~--~----~------------~-------~--~----~ 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 For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks for the response. We were aware that the rails helpers fabricate the extra parameter via javascript and our concern were for all those mail clients who disable js for spam protection. We''ll have a look into whether our e-mail could be rewritten using HTML forms instead. Thanks, Brittain On Jul 11, 2:52 pm, DrMark <drm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Brittain, > > Most browsers and other clients (likeemail) only use the HTML verbs > GET and POST. Although, this may be corrected in the future, as XHTML5 > fixes some of the problems with HTML4. > > In order to overcome this problem, Rails uses an overloaded post > method for the missing verbs. This means that Rails includes a hidden > value in a form indicating the verb (like PUT and DELETE). > > For example, in your edit form, you will have a field like: > > <input name ="_method" type="hidden" value="put" /> > > DELETE follows a similar format. > > As long as your client is able to submit forms, you should be ok. This > URL might be helpful to you:http://www.b-simple.de/documents/download/6 > I would also suggest the book RESTful Web Services from O''Reilly. > > Good luck! > > On Jul 9, 6:26 am, Brittain <britta1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Simple question really, how do I invoke a non-GETRESTaction from a > > non-browser client, like ane-mail? > > > In our rails 1.1.6 app, we have outbound e-mails that provide the > > reader several actions they can perform directly from theire-mail > > reader by clicking the link. Most of these actions would be POST or > > DELETE verbs. > > > When we migrate to 1.2 andRESThow do we implement such links? The > > syntax for custom actions (e.g. "/projects/1;close") seems close, but > > does this work for the built-in verbs too? > > > Thanks in advance, Brittain- Hide quoted text - > > - Show quoted text ---~--~---------~--~----~------------~-------~--~----~ 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 For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---