<%% editing = @event["path"].include?("edit") %> <%% action = editing ? "/<%= plural_table_name %>/#{<%= singular_table_name %>.id}" : "/<%= plural_table_name %>" %> <%%= form_tag(action) do %> <%% if editing -%> <%% end -%> <%% if <%= singular_table_name %>.errors.any? %>

<%%= pluralize(<%= singular_table_name %>.errors.count, "error") %> prohibited this <%= singular_table_name %> from being saved:

<%% end %> <% attributes.each do |attribute| -%>
<% if attribute.password_digest? -%> <%%= label_tag :password %> <%%= password_field_tag :password, <%= singular_table_name %>.<%= attribute.column_name %> %>
<%%= label_tag :password_confirmation %> <%%= password_field_tag :password_confirmation, <%= singular_table_name %>.<%= attribute.column_name %> %> <% else -%> <%%= label_tag :<%= attribute.column_name %> %> <%%= <%= attribute.field_type %>_tag "<%= "#{singular_table_name}[#{attribute.column_name}]" %>"<%= ", 'yes'" if attribute.field_type =~ /check_box/ %>, <%= singular_table_name %>.<%= attribute.column_name %> %> <% end -%>
<% end -%>
<%%= submit_tag("Submit") %>
<%% end %>