Sha256: d66e561b83303b2595ae45d65b6fa003c50d8816e0ce3806bf9802599bacfac3

Contents?: true

Size: 1.9 KB

Versions: 19

Compression:

Stored size: 1.9 KB

Contents

= simple_form_for(@<%= singular_table_name %>) do |f|
  = f.error_notification

<%- attributes.each do |attribute| -%>
  .form-group
    = f.label "<%= attribute.name %>", class: "col-sm-3 control-label"
    .col-sm-9
<%- if attribute.type.to_s == "text" -%>
      = f.text_area :<%= attribute.name %>, class: "form-control redactor", label: false
<%- elsif attribute.type.to_s == "date" -%>
      = f.text_field :<%= attribute.name %>, class: "form-control default-date-picker parsley-validated", required: true, label: false if @<%= singular_table_name %>.<%= attribute.name %>.blank?
      - if @<%= singular_table_name %>.<%= attribute.name %>.present?
        = f.text_field :<%= attribute.name %>, class: "form-control default-date-picker parsley-validated", required: true, label: false, :value => @<%= singular_table_name %>.<%= attribute.name %>.strftime("%d/%m/%Y")
<%- elsif attribute.name.match("image") || attribute.name.match("img") || attribute.name.match("avatar") -%>
      = f.input :<%= attribute.name %>, input_html: {class: "form-control parsley-validated"},label: false, required: true if @<%= singular_table_name %>.<%= attribute.name %>.blank?
      - if @<%= singular_table_name %>.<%= attribute.name %>.present?
        = f.input :<%= attribute.name %>, input_html: {class: "form-control parsley-validated"},label: false
        = link_to image_path(@<%= singular_table_name %>.<%= attribute.name %>), :'data-lightbox' => "example-set" do
          = image_tag(@<%= singular_table_name %>.<%= attribute.name %>.admin)
<%- else -%>
      = f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %>, input_html: {class: "form-control parsley-validated"}, required: true, label: false
<%- end -%>
<%- end -%>


  .form-actions
    .row
      .col-sm-9.col-sm-offset-3
        .btn-toolbar
          = f.button :submit, class: "btn-primary btn", onclick: "javascript:$('form').parsley( 'validate' )"

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
wrgem-0.0.39 lib/generators/wradmin/template/lib/templates/slim/scaffold/_form.html.slim
wrgem-0.0.38 lib/generators/wradmin/template/lib/templates/slim/scaffold/_form.html.slim
wrgem-0.0.37 lib/generators/wradmin/template/lib/templates/slim/scaffold/_form.html.slim
wrgem-0.0.35 lib/generators/wradmin/template/lib/templates/slim/scaffold/_form.html.slim
wrgem-0.0.32 lib/generators/wradmin/template/lib/templates/slim/scaffold/_form.html.slim
wrgem-0.0.31 lib/generators/wradmin/template/lib/templates/slim/scaffold/_form.html.slim
wrgem-0.0.30 lib/generators/wradmin/template/lib/templates/slim/scaffold/_form.html.slim
wrgem-0.0.29 lib/generators/wradmin/template/lib/templates/slim/scaffold/_form.html.slim
wrgem-0.0.28 lib/generators/wradmin/template/lib/templates/slim/scaffold/_form.html.slim
wrgem-0.0.27 lib/generators/wradmin/template/lib/templates/slim/scaffold/_form.html.slim
wrgem-0.0.26 lib/generators/wradmin/template/lib/templates/slim/scaffold/_form.html.slim
wrgem-0.0.25 lib/generators/wradmin/template/lib/templates/slim/scaffold/_form.html.slim
wrgem-0.0.24 lib/generators/wradmin/template/lib/templates/slim/scaffold/_form.html.slim
wrgem-0.0.23 lib/generators/wradmin/template/lib/templates/slim/scaffold/_form.html.slim
wrgem-0.0.22 lib/generators/wradmin/template/lib/templates/slim/scaffold/_form.html.slim
wrgem-0.0.21 lib/generators/wradmin/template/lib/templates/slim/scaffold/_form.html.slim
wrgem-0.0.20 lib/generators/wradmin/template/lib/templates/slim/scaffold/_form.html.slim
wrgem-0.0.19 lib/generators/wradmin/template/lib/templates/slim/scaffold/_form.html.slim
wrgem-0.0.18 lib/generators/wradmin/template/lib/templates/slim/scaffold/_form.html.slim