<% flag_map = property[:flag_map] name = property[:name] label = property[:pretty_name] required = !property[:nullable?] || property[:serial?] %>
<% if flag_map # Enum or Flag type %> <% collection = flag_map.map{|x| [x[1], x[1].to_s.capitalize.gsub('_', ' ')]}.sort{|a, b| a[1] <=> b[1]} %> <%= select(name, :collection => collection, :label => label) %> <% else %> <% length = property[:length] %> <%= text_field(name, :maxlength => length, :label => label) %>

<%= required ? "Required." : "Optional." %>

<% end %>