You don't (really) want a GET action to result in a DELETE, though, so I would recommend that rather than try to make the link in the e-mail delete the record immediately, take the user to a regular page, where you can construct a POST to DELETE, in the usual Rails manner (method: :delete). That gives a person a chance to reconsider, too, in case they fat-fingered the link in a mobile e-mail client.
Walter
> On Jan 10, 2018, at 6:24 AM, Ralph Shnelvar <ralphs@dos32.com> wrote:
>
> I have a mailing list in a Postgres database and I want to give my users the ability to unsubscribe from mailings.
>
> I wish to send out emails with a link to an RoR website to handle the unsubscribe.
>
> Is there a document anywhere that describes how to do this properly? That is, what the link in the email should look like and what the controller(s), routes.rb, and view(s) should look like?
>
> Do I need to do a (implied) DELETE verb anywhere?
>
> Ralph
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/a72da346-e897-4eba-a9d0-1fac72ebf872%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/3E1FB327-9665-409A-970A-C9C648B301C5%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment