Editing <%= human_name.titleize %> #<%%= @<%= singular_table_name %>.id %>
<% if named_routes? -%>
<%%= form_tag(<%= singular_table_name %>_url(@<%= singular_table_name %>), method: 'patch') do %>
<% else -%>
<%%= form_tag("/<%= plural_name %>/#{<%= singular_table_name %>.id}", method: 'patch') do %>
<% end -%>
<% attributes.each do |attribute| -%>
<%%= label_tag :<%= attribute.name %> %>
<% if attribute.field_type == :date_select || attribute.field_type == :time_select || attribute.field_type == :datetime_select -%>
<%%= text_field_tag :<%= attribute.name %>, @<%= singular_table_name %>.<%= attribute.name %> %>
<% elsif attribute.field_type == :check_box -%>
<%%= check_box_tag :<%= attribute.name %>, 1, @<%= singular_table_name %>.<%= attribute.name %>? %>
<% else -%>
<%%= <%= attribute.field_type %>_tag :<%= attribute.name %>, @<%= singular_table_name %>.<%= attribute.name %><%= "?" if attribute.type == :boolean %> %>
<% end -%>
<% end -%>
<%%= submit_tag "Update <%= human_name.titleize %>" %>
<%% end %>