Skip to content

Instantly share code, notes, and snippets.

@jtrim
Created January 7, 2012 00:09
Show Gist options
  • Select an option

  • Save jtrim/1573185 to your computer and use it in GitHub Desktop.

Select an option

Save jtrim/1573185 to your computer and use it in GitHub Desktop.
def try_cached_event
unless (id = cookies[Event::IDENTITY_KEY]) && (event = Event.find_by_id(id))
cookies[Event::IDENTITY_KEY] = { expires: 1.day.ago }
return
end
redirect_to event_participants_url(event)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment