Sha256: fb1a8398a736bae6ca98ada4d6a5a6c8fe819ad2a57c951b9e1a33f04385699c

Contents?: true

Size: 951 Bytes

Versions: 30

Compression:

Stored size: 951 Bytes

Contents

module C80Estate
  class AjaxAreasController < ActionController::Base

    def exel_import

      is_ok = true
      errs = {
          "areas_exel" => [

          ]
      }

      begin
        @import_result = Area.import_excel(params[:file])
      rescue => e
        Rails.logger.debug "ERROR: #{e}"
        errs["areas_exel"].push(e.to_s)
        is_ok = false
      end

      # TODO:: Excel: реализовать вывод тех ошибок, которые возникли при импорте: например: таблица была импортирована за исключением таких-то полей

      respond_to do |format|
        if is_ok
          format.js { render json: errs, status: :ok }
          format.json
          format.html
        else
          format.js { render json: errs, status: :unprocessable_entity }
          format.json
          format.html
        end
      end

    end

  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
c80_estate-0.1.0.39 app/controllers/c80_estate/ajax_areas_controller.rb
c80_estate-0.1.0.38 app/controllers/c80_estate/ajax_areas_controller.rb
c80_estate-0.1.0.37 app/controllers/c80_estate/ajax_areas_controller.rb
c80_estate-0.1.0.36 app/controllers/c80_estate/ajax_areas_controller.rb
c80_estate-0.1.0.35 app/controllers/c80_estate/ajax_areas_controller.rb
c80_estate-0.1.0.34 app/controllers/c80_estate/ajax_areas_controller.rb
c80_estate-0.1.0.33 app/controllers/c80_estate/ajax_areas_controller.rb
c80_estate-0.1.0.32 app/controllers/c80_estate/ajax_areas_controller.rb
c80_estate-0.1.0.31 app/controllers/c80_estate/ajax_areas_controller.rb
c80_estate-0.1.0.30 app/controllers/c80_estate/ajax_areas_controller.rb
c80_estate-0.1.0.29 app/controllers/c80_estate/ajax_areas_controller.rb
c80_estate-0.1.0.28 app/controllers/c80_estate/ajax_areas_controller.rb
c80_estate-0.1.0.27 app/controllers/c80_estate/ajax_areas_controller.rb
c80_estate-0.1.0.26 app/controllers/c80_estate/ajax_areas_controller.rb
c80_estate-0.1.0.25 app/controllers/c80_estate/ajax_areas_controller.rb
c80_estate-0.1.0.24 app/controllers/c80_estate/ajax_areas_controller.rb
c80_estate-0.1.0.23 app/controllers/c80_estate/ajax_areas_controller.rb
c80_estate-0.1.0.22 app/controllers/c80_estate/ajax_areas_controller.rb
c80_estate-0.1.0.21 app/controllers/c80_estate/ajax_areas_controller.rb
c80_estate-0.1.0.20 app/controllers/c80_estate/ajax_areas_controller.rb