Moving information, according to the date, how to do it?

image

I want to move my table rows as I change the date, so I’ll know when it has value on the specified day, how can I?

CONTROLLER

class ComparativecashflowController < ApplicationController
def index


    @cashflows= Cashflow.total

 
  end
    

end

MODEL

class cashflow < ApplicationRecord

  def self.total

      self.where(nome: 'customers').sum(:valor)

        
      end
    
    end

VIEWS

  <tr>
    <th class="titulo">NAME</th>
    <th class="titulo"><input type="date"></th>
    <th class="titulo"><input type="date"></th>
    <th class="titulo">DIF</th>
    
  </tr>