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? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
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. --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---