Sha256: f171a5cb34e957ce541c12b5e6efd9abd9d69e82c3f59efcf2ca445b7bf7ca34

Contents?: true

Size: 1.17 KB

Versions: 1

Compression:

Stored size: 1.17 KB

Contents

<%%= form_with(model: <%= "[:#{prefix}, #{singular_table_name}]" %>, local: true) do |form| %>
  <%% 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 |message| %>
        <li><%%= message %></li>
      <%% end %>
      </ul>
    </div>
  <%% end %>

<% attributes.each do |attribute| -%>
  <div class="field">
<% if attribute.password_digest? -%>
    <%%= form.label :password %>
    <%%= form.password_field :password %>
</div>
  <div>
    <%%= form.label :password_confirmation %>
    <%%= form.password_field :password_confirmation %>
<% else -%>
  <% if attribute.reference? -%>
  <%%= form.label :<%= attribute.column_name %> %>
    <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %> %>
  <% else -%>
  <%%= form.label :<%= attribute.name %> %>
    <%%= form.<%= attribute.field_type %> :<%= attribute.name %> %>
  <% end -%>
<% end -%>
</div>

<% end -%>
  <div class="actions">
    <%%= form.submit %>
  </div>
<%% end %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
admin_help-0.1.3 lib/generators/admin/scaffold_controller/templates/views/erb/_form.html.erb.erb