Sha256: 9818e2d3f56b8c0e95894adcc766dab085c49a800f9bf3a5ca5c55482b9ef6f8

Contents?: true

Size: 588 Bytes

Versions: 33

Compression:

Stored size: 588 Bytes

Contents

require_dependency "tax_jp/application_controller"

module TaxJp
  class WithheldTaxesController < ApplicationController
    before_action :preload_finder

    def index
      @withheld_taxes = TaxJp::WithheldTax.find_all_by_date(@finder.from)
    end

    private
    
    def preload_finder
      @finder = TaxJp::Finder.new(finder_params)
      @finder.from ||= Date.today.strftime('%Y-%m-%d')
    end
  
    def finder_params
      if params[:finder].present?
        params.require(:finder).permit(:from)
      else
        {}
      end
    end

  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
tax_jp-1.2.11 app/controllers/tax_jp/withheld_taxes_controller.rb
tax_jp-1.2.10 app/controllers/tax_jp/withheld_taxes_controller.rb
tax_jp-1.2.9 app/controllers/tax_jp/withheld_taxes_controller.rb
tax_jp-1.2.8 app/controllers/tax_jp/withheld_taxes_controller.rb
tax_jp-1.2.7 app/controllers/tax_jp/withheld_taxes_controller.rb
tax_jp-1.2.6 app/controllers/tax_jp/withheld_taxes_controller.rb
tax_jp-1.2.5 app/controllers/tax_jp/withheld_taxes_controller.rb
tax_jp-1.2.4 app/controllers/tax_jp/withheld_taxes_controller.rb
tax_jp-1.2.3 app/controllers/tax_jp/withheld_taxes_controller.rb
tax_jp-1.2.2 app/controllers/tax_jp/withheld_taxes_controller.rb
tax_jp-1.2.1 app/controllers/tax_jp/withheld_taxes_controller.rb
tax_jp-1.2.0 app/controllers/tax_jp/withheld_taxes_controller.rb
tax_jp-1.1.12 app/controllers/tax_jp/withheld_taxes_controller.rb
tax_jp-1.1.11 app/controllers/tax_jp/withheld_taxes_controller.rb
tax_jp-1.1.10 app/controllers/tax_jp/withheld_taxes_controller.rb
tax_jp-1.1.9 app/controllers/tax_jp/withheld_taxes_controller.rb
tax_jp-1.1.8 app/controllers/tax_jp/withheld_taxes_controller.rb
tax_jp-1.1.7 app/controllers/tax_jp/withheld_taxes_controller.rb
tax_jp-1.1.6 app/controllers/tax_jp/withheld_taxes_controller.rb
tax_jp-1.1.5 app/controllers/tax_jp/withheld_taxes_controller.rb