Sign in through GitHub

RailsCasts Pro episodes are now free!

Learn more or hide this

Michael Grosser's Profile

GitHub User: grosser


Comments by Michael Grosser


You could use UrlStore and just encode user id and expiration time inside the url, no new columns needed. Only drawback is that the token gets longer.

code = UrlStore.encode([, 2.hours.from_now])
if id, expires = UrlStore.decode(params[:id])
  if expires >