Forum: Ruby on Rails Problem with string "merging" / escaping

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Elan F. (Guest)
on 2006-02-17 04:28
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:

<select name="event[meet_at(1i)]">
["<option value=\"2006\" selected=\"selected\">2006</option>\n",
"<option value=\"2007\">2007</option>\n", "<option
value=\"2008\">2008</option>\n", "<option
value=\"2009\">2009</option>\n", "<option
value=\"2010\">2010</option>\n", "<option
value=\"2011\">2011</option>\n"]</select>

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:

<p>There were problems with the following fields:</p><ul>["<li>Phone
number has already been taken</li>", "<li>Password is too short (min is
5 characters)</li>"]</ul>

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

Any ideas?

-elan
This topic is locked and can not be replied to.