Sha256: dfd896ed3f3db277e717d2174367e7b8be7d037d1c28d76ee3cc81162c9f32da

Contents?: true

Size: 719 Bytes

Versions: 1

Compression:

Stored size: 719 Bytes

Contents

require_dependency "buttafly/application_controller"

module Buttafly
  class SpreadsheetsController < ApplicationController
    
    before_action :set_spreadsheet, except: [:create]
    

    def create
      @spreadsheet = Buttafly::Spreadsheet.new(spreadsheet_params)

      if @spreasheet.save
        redirect_to spreadsheets_path, notice: "The spreadsheet #{@spreadsheet.name} has been uploaded."
      else
        render "new"
      end
  
    end
    
    def import
    end

    def process_file
    end

    private

    def set_spreadsheet
      @spreadsheet = spreadsheet.find(params[:id])
    end

    def spreadsheet_params
      params.require(:spreadsheet).permit(:name, :flat_file)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
buttafly-0.0.1 app/controllers/buttafly/spreadsheets_controller.rb