Sha256: 9b3f541074936eb89ad1a7d6e92d8a64e7709a43487642f584ec4289093b2235

Contents?: true

Size: 1.03 KB

Versions: 1

Compression:

Stored size: 1.03 KB

Contents

= form_with(model: <%= model_resource_name %>) do |form|
  - if <%= singular_table_name %>.errors.any?
    div style="color: red"
      h2 = "#{pluralize(<%= singular_table_name %>.errors.count, "error")} prohibited this <%= singular_table_name %> from being saved:"
      ul
        - <%= singular_table_name %>.errors.each do |error|
          li = error.full_message

<% attributes.each do |attribute| -%>
  div
<% if attribute.password_digest? -%>
    = form.label :password, style: "display: block"
    = form.password_field :password

  div
    = form.label :password_confirmation, style: "display: block"
    = form.password_field :password_confirmation
<% elsif attribute.attachments? -%>
    = form.label :<%= attribute.column_name %>, style: "display: block"
    = form.<%= attribute.field_type %> :<%= attribute.column_name %>, multiple: true
<% else -%>
    = form.label :<%= attribute.column_name %>, style: "display: block"
    = form.<%= attribute.field_type %> :<%= attribute.column_name %>
<% end -%>

<% end -%>
  div
    = form.submit

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
slim-rails-3.6.3 lib/generators/slim/scaffold/templates/_form.html.slim.tt