Skip to content
This repository
tag: v3.0.5
Fetching contributors…

Cannot retrieve contributors at this time

file 23 lines (21 sloc) 0.71 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
<%%= form_for(@<%= singular_table_name %>) do |f| %>
  <%% if @<%= singular_table_name %>.errors.any? %>
    <div id="error_explanation">
      <h2><%%= pluralize(@<%= singular_table_name %>.errors.count, "error") %> prohibited this <%= singular_table_name %> from being saved:</h2>

      <ul>
      <%% @<%= singular_table_name %>.errors.full_messages.each do |msg| %>
        <li><%%= msg %></li>
      <%% end %>
      </ul>
    </div>
  <%% end %>

<% for attribute in attributes -%>
  <div class="field">
    <%%= f.label :<%= attribute.name %> %><br />
    <%%= f.<%= attribute.field_type %> :<%= attribute.name %> %>
  </div>
<% end -%>
  <div class="actions">
    <%%= f.submit %>
  </div>
<%% end %>
Something went wrong with that request. Please try again.