First published on Fencore Ltd.’s Posterous page on July 13th, 2010
In Rails 2.3.8, the following is produced by the scaffold generator:
<td><%= link_to 'Destroy', common_contents, :confirm => 'Are you sure?', :method => :delete %></td>
If you want to break the ‘confirm’ message over multiple lines, it is important to note that the generator has enclosed the message in single quotes. To make the line break, use \n and change the single quotes to double quotes.
<td><%= link_to 'Destroy', common_contents, :confirm => "Danger/nAre you sure?", :method => :delete %></td>
You’ll then get