Sha256: 394ce262b2b850d9e1e8960b96a4baa0536874aaf9b690c74e049f585ea64b5c

Contents?: true

Size: 1.32 KB

Versions: 2

Compression:

Stored size: 1.32 KB

Contents

<%- if defined?(SimpleForm) -%>
= simple_form_for(@<%= singular_table_name %>, <%= KisoThemes.key_value :wrapper, ":horizontal_form" %>, <%= KisoThemes.key_value :html, '{ ' + KisoThemes.key_value(:class, "'form-horizontal'") + ' }' %>) do |f|
  = f.error_notification

  .form-inputs
  <%- attributes.each do |attribute| -%>
    = f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %>
  <%- end -%>

  .form-actions.col-md-offset-3.col-md-9
    = f.button :submit
    = f.button :cancel, <%= KisoThemes.key_value :to, "#{index_helper}_path" %>
<%- else -%>
= form_for(@<%= singular_table_name %>, <%= KisoThemes.key_value :html, '{ ' + KisoThemes.key_value(:class, "'form-horizontal'") + ' }' %>) do |f|
  = f.error_notification

  .form-inputs
  <%- attributes.each do |attribute| -%>
    = f.form_group :<%= attribute.name %> do |f|
      = f.label :<%= attribute.name %>, <%= KisoThemes.key_value :class, "'control-label col-md-2'" %>
      .col-md-8
        = f.<%= attribute.field_type %> :<%= attribute.name %>, <%= KisoThemes.key_value :class, "'form-control'" %>
        = f.error_messages
  <%- end -%>

  .form-actions.col-md-offset-3.col-md-9
    = f.submit <%= KisoThemes.key_value :class, "'btn btn-primary'" %>
    = link_to "Cancel", <%= index_helper %>_path, <%= KisoThemes.key_value :class, "'btn'" %>
<%- end -%>

Version data entries

2 entries across 1 versions & 1 rubygems

Version Path
kiso_themes-1.0.2 lib/templates/haml/scaffold/_form.html.haml
kiso_themes-1.0.2 lib/templates/slim/scaffold/_form.html.haml