Sha256: 4684379cf7727ccd03e091cba34a441623b21d68d3c13704ffbf97acf4df3112

Contents?: true

Size: 1.37 KB

Versions: 2

Compression:

Stored size: 1.37 KB

Contents

<%%= form_with(model: <%= model_resource_name %>) do |form| %>
  <%% if <%= singular_table_name %>.errors.any? %>
    <h2><%%= pluralize(<%= singular_table_name %>.errors.count, "error") %> prohibited this <%= singular_table_name %> from being saved:</h2>

    <ul class="list--unindented">
      <%% <%= singular_table_name %>.errors.each do |error| %>
        <li><%%= error.full_message %></li>
      <%% end %>
    </ul>
  <%% end %>

<% attributes.each do |attribute| -%>
  <div>
<% if attribute.password_digest? -%>
    <%%= form.label :password, class: "u-display-b txt--bold push-xs--bottom" %>
    <%%= form.password_field :password, class: "input" %>
  </div>

  <div>
    <%%= form.label :password_confirmation, class: "u-display-b txt--bold push-xs--bottom" %>
    <%%= form.password_field :password_confirmation, class: "input" %>
<% elsif attribute.attachments? -%>
    <%%= form.label :<%= attribute.column_name %>, class: "u-display-b txt--bold push-xs--bottom" %>
    <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, multiple: true, class: "input" %>
<% else -%>
    <%%= form.label :<%= attribute.column_name %>, class: "u-display-b txt--bold push-xs--bottom" %>
    <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, class: "input" %>
<% end -%>
  </div>

<% end -%>
  <div>
    <%%= form.submit class: "btn btn--primary" %>
  </div>
<%% end %>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sass-zero-1.5.7 lib/generators/sass_zero/scaffold/templates/_form.html.erb.tt
sass-zero-1.5.6 lib/generators/sass_zero/scaffold/templates/_form.html.erb.tt