Array in database field

Hi,

i have an array of strings in a database field. When the scaffold
CREATE method inserts them into the database i have a number of hyphens
in my data.

e.g

– - string1 - string2 - string3

has anybody else experienced this, or know how to prevent the hyphens
appearing.

anybody know why they are appearing?

Hello,

i have an array of strings in a database field. When the
scaffold CREATE method inserts them into the database
i have a number of hyphens in my data.

e.g
– - string1 - string2 - string3

has anybody else experienced this, or know how to prevent the hyphens
appearing.

When you declare a serialized column with :
serialize :foo

data in foo column is stored in YAML format (ie the same format
as config/database.yml and fixtures).

Look how an array of strings appears in YAML format in irb :

$ irb
irb(main):001:0> require ‘yaml’
=> true
irb(main):002:0> %w(un deux trois).to_yaml
=> “— \n- un\n- deux\n- trois\n”

– Jean-François.


Ã? la renverse.