Forum: Ruby on Rails creating a temporary link with rails

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
8f778136a1ac3f33ff7b6ff52869f9f5?d=identicon&s=25 Colin (Guest)
on 2007-01-12 01:01
Is there a plug-in or anything to create a temporary link in rails?

I understand that alot of websites use this. For example an email is
sent to a user with a temporary link to change their password, download
something, etc. The link is temporary and after this link is used once
it can not be used again.

Thanks
C91098dc76d7ad473165ef24fe805312?d=identicon&s=25 Nanyang Zhan (xain)
on 2007-01-12 11:13
> For example an email is
> sent to a user with a temporary link to change their password, download
> something, etc. The link is temporary and after this link is used once
> it can not be used again.

 I thought these links were not temporary, but with special params.
A952aedba7fa87b570c6393926128eeb?d=identicon&s=25 jil (Guest)
on 2007-01-12 13:46
Colin wrote:
> Is there a plug-in or anything to create a temporary link in rails?
>
> I understand that alot of websites use this. For example an email is
> sent to a user with a temporary link to change their password, download
> something, etc. The link is temporary and after this link is used once
> it can not be used again.
>
> Thanks

you can create something unique for that user in the database when he do
the request (for example change his email), and then send a url with
that unique key. in the controller you can find the user by that key and
then show the page for change the email, when the user has changed his
email you can delete the key from the database... what do you think? :)

(sorry for my english)
8f778136a1ac3f33ff7b6ff52869f9f5?d=identicon&s=25 Colin (Guest)
on 2007-01-12 18:31
jil wrote:

> you can create something unique for that user in the database when he do
> the request (for example change his email), and then send a url with
> that unique key. in the controller you can find the user by that key and
> then show the page for change the email, when the user has changed his
> email you can delete the key from the database... what do you think? :)

Thats a good idea, I think ill do something similar to this.
Thanks for the advice.

cheers
This topic is locked and can not be replied to.