app/views/main/_date.html.erb in sferik-merb-admin-0.2.7 vs app/views/main/_date.html.erb in sferik-merb-admin-0.2.8
- old
+ new
@@ -1,7 +1,7 @@
-<% value = eval("@object.#{property.field}") %>
+<% value = @object.send(property[:name]) %>
<div>
- <%= text_field(property.name, :class => "vDateField", :label => property.field.capitalize.gsub('_', ' '), :value => value.respond_to?(:strftime) ? value.strftime("%Y-%m-%d") : nil) %>
+ <%= text_field(property[:name], :class => "vDateField", :label => property[:pretty_name].capitalize, :value => value.respond_to?(:strftime) ? value.strftime("%Y-%m-%d") : nil) %>
<p class="help">
- <%= !property.nullable? ? "Required." : "Optional." %>
+ <%= !property[:nullable?] ? "Required." : "Optional." %>
</p>
</div>