h1 Listing bills table.table.table-condensed.table-striped thead tr td ID th Client th Title th Description th Amount th Paid th Emission date th Due date th th th tbody - @bills.each do |bill| tr td = link_to("##{bill.id}", bill) td = link_to bill.client.name, bill.client td = link_to bill.title, bill td = bill.description td = bill.amount td = bill.paid td = distance_of_time_in_words_to_now(bill.emission_date) + " - " + bill.emission_date.to_s(:long) if bill.emission_date - if bill.due_date < Date.today - if bill.paid td.bg-success = distance_of_time_in_words_to_now(bill.due_date) + " - " + bill.due_date.to_s(:long) - else td.bg-danger = distance_of_time_in_words_to_now(bill.due_date) + " - " + bill.due_date.to_s(:long) - else td.bg-info = distance_of_time_in_words_to_now(bill.due_date).to_s + " - " + bill.due_date.to_s(:long) td = link_to '', bill, class: 'glyphicon glyphicon-eye-open' td = link_to '', edit_bill_path(bill), class: 'glyphicon glyphicon-pencil' td = link_to '', bill, data: {:confirm => 'Are you sure?'}, :method => :delete, class: 'glyphicon glyphicon-remove-sign' br = link_to 'New Bill', new_bill_path, class: 'btn btn-sm btn-default'