brokenfingers/Fabric_Manager

View on GitHub
app/views/fabric/index.html.haml

Summary

Maintainability
Test Coverage
%body.user_show
  = render 'shared/top_menu_bar'

  = render 'shared/side_menu_bar'

  %p#activate_field Search By S/N
  %div#fabric_input_field
    %p Enter the Fabric S/N:
    / Create a form to input the serial number
    = simple_form_for :fabric, remote: true, :url => search_user_fabric_index_path(current_user) do |f|
      = f.input :serial, :as => :string
      = f.submit "Show Fabric"

  %div#fabric_list
    / List out all the fabric just name and price
    %table.table.table-hover
      %thead
        %tr
          %th Color
          %th Serial
          %th Price
      %tbody
        - if @fabrics.any?
          - @fabrics.each do |fabric|
            %tr
              %td= link_to "#{fabric.color}", user_fabric_path(current_user, fabric), :method => "get", :remote => true
              %td= link_to "#{fabric.serial}", user_fabric_path(current_user, fabric), :method => "get", :remote => true
              %td= fabric.price

  %div#info_field
  
  %div#calculate_fields

  %div#update_info_field