my table has Attachment.attachment_content_type which is of type string. Values look like this:
[]
[image/png]
[application/msword, application/word, application/x-msword, application/x-word, text/plain]
What I want to do is get the first item if any.
I'm trying with:
attachment.attachment_content_type[0]
But that just returns [ and not 'application/msword'
Should I use a split or is there a better way with ruby on rails to tell rails this is an array? Thanks
serializeto store/retrieve a real Ruby array, or consider creating a has_many relationship to another table (probably overkill for this).