# Problem with string "merging" / escaping

**URL:** <https://www.ruby-forum.com/t/problem-with-string-merging-escaping/69506>\
**Category:** Rails\
**Created:** [February 17, 2006, 3:28am UTC](https://www.ruby-forum.com/t/problem-with-string-merging-escaping/69506 "2006-02-17T03:28:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![elan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/3e96dc/32.png) [@elan](https://www.ruby-forum.com/u/elan)\
**Post date:** [February 17, 2006, 3:28am UTC](https://www.ruby-forum.com/t/problem-with-string-merging-escaping/69506/1 "2006-02-17T03:28:29Z")

</div>

I’m on Mac OS 10.4.3, Ruby 1.8.2, Rails 1.0, MySQL 5,  
SaltedHashLoginGenerator and I’m seeing a strange problem where  
sometimes generated HTML isn’t quite correct, in the following way:

My code:

\<%= datetime\_select :event, :meet\_at, :start\_year =\> 2006 %\>

Generated code:

["2006\n", "2007\n", "2008\n", "2009\n", "2010\n", "2011\n"]

As you can see, it looks like the array of strings never got put back  
together into a string. Strangest of all, it only seems to happen  
sometimes. I just saw it happen with a flash, too, where my code prints  
@flash[‘notice’] and what got generated was:

There were problems with the following fields:

["- Phone number has already been taken
", "- Password is too short (min is 5 characters)
"]

If you look closely, you’ll see that it again looks like an Array rather  
than a string.

Any ideas?

-elan
