<% if any_tabs? %>
<% tab_count = 1 %>
<% end %> <% unless any_tabs? %>
New <%= resource.underscore.pluralize.humanize %> Edit <%= resource.underscore.pluralize.humanize %> <% first = true %> <% fields.each do |field_name, field_type| %> <% if first %>
<% end %>
<% case field_type when "belongs_to" %> <% when "has_many" %> <% when "in" %> <% when "text" %> <% when "boolean" %> required<% end %> /> <% when "datetime" %> required<% end %> /> <% when "string", nil %> required<% end %> /> <% else %> required<% end %> /> <% end %>
<% if not first %>
<% end %> <% first = !first %> <% end %>
<% else %><% tab_count = 1 %><% tabs.each do |name, field_names| %>
New <%= name %> Edit <%= name %><% first = true %> <% fields.each do |field_name, field_type| %><% if tabs[name].include? field_name or tabs[name].include? "__all__" %> <% if first %>
<% end %>
<% case field_type when "belongs_to" %> <% when "has_many" %> <% when "in" %> <% when "text" %> <% when "boolean" %> required<% end %> /> <% when "datetime" %> required<% end %> /> <% when "string", nil %> required<% end %> /> <% else %> required<% end %> /> <% end %>
<% if not first %>
<% end %> <% first = !first %> <% end %> <% end %>
<% tab_count += 1 %> <% end %> <% end %>