lib/populate_me/mongo/crushyform.rb in populate-me-0.0.11 vs lib/populate_me/mongo/crushyform.rb in populate-me-0.0.12
- old
+ new
@@ -35,10 +35,10 @@
:price => proc do |m,c,o|
crushid = m.field_id_for(c)
price_main, price_cents = o[:input_value].to_i.divmod(100)
out = "<input type='text' name='%s[]' id='%s-main' class='%s price-main' value='%s' size='10' /> • "
out << "<input type='text' name='%s[]' id='%s-cents' class='%s price-cents' value='%s' size='2' maxlength='2' />"
- out % [o[:input_name], crushid, o[:input_class], price_main, o[:input_name], crushid, o[:input_class], price_cents]
+ out % [o[:input_name], crushid, o[:input_class], price_main, o[:input_name], crushid, o[:input_class], "%02d" % price_cents]
end,
:boolean => proc do |m,c,o|
crushid = m.field_id_for(c)
checked = 'checked' if o[:input_value]
out = "<input type='hidden' name='%s' value='false' id='%s-off' />\n"