Sha256: 153d6f221e34e500af94ae38e6ba3dd6c388a58ef6f15385171e748d47161f62
Contents?: true
Size: 1 KB
Versions: 62
Compression:
Stored size: 1 KB
Contents
module Workarea module Admin class DataFileTaxImportsController < Admin::ApplicationController required_permissions :settings before_action :find_tax_category def new @import = DataFile::TaxImport.new end def create @import = DataFile::TaxImport.new(import_params) if @import.save flash[:success] = t('workarea.admin.data_file_tax_imports.flash_messages.processing') redirect_to tax_category_path(@tax_category) else render :new, status: :unprocessable_entity end end private def find_tax_category @tax_category = if params[:tax_category_id].present? Tax::Category.find(params[:tax_category_id]) elsif import_params[:tax_category_id].present? Tax::Category.find(import_params[:tax_category_id]) end end def import_params params.fetch(:import, {}).merge(created_by_id: current_user.id) end end end end
Version data entries
62 entries across 62 versions & 1 rubygems