Sha256: 9449cd56b7731e0b5e8e1e7e82d5f84d91ffe001e3b16fb3812871b506270b0b

Contents?: true

Size: 893 Bytes

Versions: 181

Compression:

Stored size: 893 Bytes

Contents

require_dependency "educode_sales/application_controller"

module EducodeSales
  class CustomerFollowsController < ApplicationController
    def create
      follow_up = EducodeSales::CustomerFollow.new(follow_up_params)
      follow_up.staff = @current_admin
      if follow_up.save
        render_success
      else
        render_failure follow_up
      end
    end

    def destroy
      follow_up = CustomerFollow.find(params[:id])
      if follow_up.destroy
        render_success
      else
        render_failure follow_up
      end
    end

    def update
      follow_up = CustomerFollow.find(params[:id])
      follow_up.assign_attributes(follow_up_params)
      if follow_up.save
        render_success
      else
        render_failure follow_up
      end
    end

    private

    def follow_up_params
      params.permit(:school_id, :department_id, :content)
    end

  end
end

Version data entries

181 entries across 181 versions & 1 rubygems

Version Path
educode_sales-1.10.74 app/controllers/educode_sales/customer_follows_controller.rb
educode_sales-1.10.73 app/controllers/educode_sales/customer_follows_controller.rb
educode_sales-1.10.72 app/controllers/educode_sales/customer_follows_controller.rb
educode_sales-1.10.71 app/controllers/educode_sales/customer_follows_controller.rb
educode_sales-1.10.70 app/controllers/educode_sales/customer_follows_controller.rb
educode_sales-1.10.59 app/controllers/educode_sales/customer_follows_controller.rb
educode_sales-1.10.58 app/controllers/educode_sales/customer_follows_controller.rb
educode_sales-1.10.49 app/controllers/educode_sales/customer_follows_controller.rb
educode_sales-1.10.48 app/controllers/educode_sales/customer_follows_controller.rb
educode_sales-1.10.46 app/controllers/educode_sales/customer_follows_controller.rb
educode_sales-1.10.41 app/controllers/educode_sales/customer_follows_controller.rb
educode_sales-1.10.37 app/controllers/educode_sales/customer_follows_controller.rb
educode_sales-1.10.36 app/controllers/educode_sales/customer_follows_controller.rb
educode_sales-1.10.35 app/controllers/educode_sales/customer_follows_controller.rb
educode_sales-1.10.34 app/controllers/educode_sales/customer_follows_controller.rb
educode_sales-1.10.33 app/controllers/educode_sales/customer_follows_controller.rb
educode_sales-1.10.31 app/controllers/educode_sales/customer_follows_controller.rb
educode_sales-1.10.30 app/controllers/educode_sales/customer_follows_controller.rb
educode_sales-1.10.29 app/controllers/educode_sales/customer_follows_controller.rb
educode_sales-1.10.28 app/controllers/educode_sales/customer_follows_controller.rb