app/views/forms/_date_time.html.erb in sferik-merb-admin-0.2.0 vs app/views/forms/_date_time.html.erb in sferik-merb-admin-0.2.1
- old
+ new
@@ -1,7 +1,8 @@
+<% value = eval("@instance.#{property.field}") %>
<div class="form-row page">
<div>
- <%= text_field(property.name, :class => "vDateField", :label => property.field.capitalize.gsub('_', ' '), :value => eval("@instance.#{property.field}").strftime("%Y-%m-%d %H:%M:%S")) %>
+ <%= text_field(property.name, :class => "vDateField", :label => property.field.capitalize.gsub('_', ' '), :value => value.respond_to?(:strftime) ? value.strftime("%Y-%m-%d %H:%M:%S") ? nil) %>
<p class="help">
<%= !property.nullable? ? "Required." : "Optional." %>
</p>
</div>
</div>