%% form_for(@<%= singular_name %>) do |f| %>
<%%= f.error_messages %>
<% for attribute in attributes -%>
<%%= f.label :<%= attribute.name %> %>
<%%= f.<%= attribute.field_type %> :<%= attribute.name %> %>
<% end -%>
<%% if @<%= singular_name %>.new_record? %>
<%%= f.submit 'Create' %>
<%% else %>
<%%= f.submit 'Update' %>
<%% end %>
<%% end %>