When the following code is run:
page.alert(@category.errors.full_messages.collect { |msg| msg + “\n” })
The following JavaScript is output:
alert(["Name is too short (minimum is 3 characters)", "Name can't be blank"]);
So, my message in the alert box looks like:
Name is too short (minimum is 3 characters)
,Name can't be blank.
The comma is on the wrong line. Any ideas on how I can get around this? I'd like to have one error per line.
Thanks in advance,
Ryan