public
Rubygem
Description: Vanilla in Ruby
Homepage: http://lazyatom.com
Clone URL: git://github.com/lazyatom/vanilla-rb.git
If the value of a snip attribute is nil, the editor shouldn't die.
lazyatom (author)
Thu Aug 28 07:44:48 -0700 2008
commit  df13f494e3a99627c4d8d41d9e63b03dc50cbd0e
tree    36246ab76c59c3879386288633559a4b72ee8787
parent  a310154f0701092b205bc39cdb1fdad28bbe92ae
...
50
51
52
53
 
54
55
56
...
50
51
52
 
53
54
55
56
0
@@ -50,7 +50,7 @@ class EditSnip < Dynasnip
0
     <dl class="attributes">
0
       <% @snip_to_edit.attributes.each do |name, value| %>
0
       <dt><%= name %></dt>
0
-      <% num_rows = value.split("\n").length + 1 %>
0
+      <% num_rows = (value || "").split("\n").length + 1 %>
0
       <dd><textarea name="<%= name %>" class="<%= name %>" rows="<%= num_rows %>"><%=h value %></textarea></dd>
0
       <% end %>
0
       <dt><input class="attribute_name" type="text"></input></dt>

Comments