_form.html.slim 825 Bytes
= simple_nested_form_for [:admin, @object] do |f|
  = f.input :name
  = f.input :editable_until
  = f.input :active
  hr
  h4
    | Matches
    = f.link_to_add 'Add Match', :matches, data: { target: '#matches' }, style: 'float:right'
  
  table
    tbody#matches
      = f.fields_for :matches, wrapper: false do |ff|
        tr
         td = ff.input_field :date, placeholder: 'Date'
         td = ff.input_field :local, placeholder: 'Local'
         td = ff.input_field :visit, placeholder: 'Visit'
         td = ff.input_field :score_local, placeholder: 'Score Local'
         td = ff.input_field :score_visit, placeholder: 'Score Visit'
         td = ff.object.result ? ff.object.result.upcase : 'Pending Result'
         td
           = ff.link_to_remove 'Remove'
  div style='text-align: center'
    = f.submit 'Save'