Sha256: 00e7fa8eededa122fe920937bb7e4bff9c8779bf20574d751e0703d809468d89
Contents?: true
Size: 1.38 KB
Versions: 5
Compression:
Stored size: 1.38 KB
Contents
<% if Gem::Specification.map(&:name).include?('simple_form') -%> = simple_form_for(<%= singular_table_name %>) do |f| = f.error_notification .form-inputs <%- attributes.each do |attribute| -%> <% if attribute.password_digest? -%> = f.input :password = f.input :password_confirmation <% else -%> <% if attribute.reference? -%> = f.association :<%= attribute.column_name.gsub(/_id$/, '') %>, prompt: t('.<%= attribute.column_name.gsub(/_id$/, '') %>', default: 'Choose') <% else -%> = f.input :<%= attribute.column_name %> <% end -%> <% end -%> <%- end -%> .form-actions = f.button :submit <% else -%> = form_for(<%= singular_table_name %>) do |f| - if <%= singular_table_name %>.errors.any? #error_explanation %h2 = t 'errors.template.header', model: t('.<%= singular_name %>'), count: <%= singular_name %>.errors.count %ul - <%= singular_table_name %>.errors.full_messages.each do |msg| %li= msg <% for attribute in attributes -%> .field <% if attribute.password_digest? -%> = f.label :password %br = f.password_field :password .field = f.label :password_confirmation %br = f.password_field :password_confirmation <% else -%> = f.label :<%= attribute.column_name %> %br = f.<%= attribute.field_type %> :<%= attribute.column_name %> <% end -%> <% end -%> .actions = f.submit <% end -%>
Version data entries
5 entries across 5 versions & 1 rubygems