%h1 Listing Data

%table.table

%thead
  %tr
    %th ID
    %th Weight[kg]
    %th BodyFat[%]
    %th Measuring Time
    %th Created Time
    %th Memo
    %th(colspan=2) Action
%tbody
  - @data.each do |d|
    %tr
      %td= d.id
      %td= d.weight
      %td= d.bodyfat
      %td= d.date
      %td= d.created_at.strftime('%Y/%m/%d %H:%M')
      %td= d.memo
      %td
        %button{class: ('btn btn-default navbar-btn')}
          %a(class="glyphicon glyphicon-edit"){href: uri("/data/#{d.id}/edit")} edit
      %td
        %form.form-inline(method='post'){action: uri("/data/#{d.id}")}
          %input(name='_method' type='hidden' value='delete')
          .form-group
            %button(class='btn btn-default navbar-btn')
              %a(class='glyphicon glyphicon-trash')
                %a(type='submit' onclick='return confirm("Delete data?")') delete