From: David Vallner Date: 2006-08-27T22:00:19+09:00 Subject: Re: Referencing an object through it's id string. Alexandre Hudelot wrote: > Thanks for the information! > > David Vallner wrote: >> Alexandre Hudelot wrote: >>> Hello, how does one set a pointer to foo using an id string obtained >>> through foo.object_id for instance? >>> >>> Thanks in advance >>> >> Considering that object ids are only valid throughout one interpreter >> run... I'm curious: why pass around the object id instead of the object >> itself? >> >> David Vallner > > > I'm having trouble passing an object reference from a template (a form) > to a controller method, what I've managed to return is the object's id > string. > Is this a web application? (Rails maybe? Seeing as the words template and controller method cropped up.) It's not quite best practice in that case since there are deployment models where this just doesn't work - anything that involves several Ruby processes serving for instance. You also want to make sure the object doesn't get garbage collected. But for simple cases, like a personal app, it's pretty much the same thing as when you'd use a session I suppose. David Vallner