Using Meta Data in a database field in a View

nobosh
2010-09-30T03:11:32Z

Hello...

Given a database with records like the following
Table: AuditLog
Fields: ID | USERID | TYPE | TIME | DATA

    id:1, userId:1, type:PHOTO, time:2008-10-15 12:00:00, data:
{photo_id:2089, photoname:"A trip to the beach"}

Lets say the database had 50 records, with Rails How can I loop
through the results as follows:


id, user_id, data.photoID, data.PhotoName


The main thing I don''t get is how to extract what''s inside the
data
column. Example given:
@mystuff = AuditLog.all
How to display something like mystuff.data.photo_id

Thanks

--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org