<table>
<%- form_for(resource, :url => resource.new_record? ? collection_url : resource_url(resource)) do |f| %>
  <% if resource.errors.any? %>
  <tr>
    <td colspan="2">
      <h2><%= pluralize(resource.errors.count, "error") %> prohibited this testa from being saved:</h2>
      <ul>
      <% resource.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </td>
  </tr>
  <% end %>
  <% resource.attributes.each do |a| %>
    <tr>
      <td><%= a[0] %></td>
      <td><%= f.text_field a[0].to_sym %></td>
    </tr>
  <% end %>
  <tr>
    <td colspan="2"><%= f.submit %></td>
  </tr>
<% end %>
</table>
<table>
<%- form_for("#{resource_class.to_s.downcase}",
      resource,
      :url => resource.new_record? ? collection_url : resource_url(resource),
      :html => { :method => (resource.new_record? ? "post" : "put") }) do |f| %>
  <% if resource.errors.any? %>
  <tr>
    <td colspan="2">
      <h2><%= pluralize(resource.errors.count, "error") %> prohibited this testa from being saved:</h2>
      <ul>
      <% resource.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </td>
  </tr>
  <% end %>
  <% resource.attributes.each do |a| %>
    <tr>
      <td><%= a[0] %></td>
      <td><%= f.text_field a[0].to_sym %></td>
    </tr>
  <% end %>
  <tr>
    <td colspan="2"><%= f.submit %></td>
  </tr>
<% end %>
</table>
Fix _form when using Single Table Inheritance (STI)
Fix _form when using Single Table Inheritance (STI)
