Class: EducodeSales::CustomerFollowsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/educode_sales/customer_follows_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#authenticate_admin, #authenticate_request, #current_user, #filter, #render_failure, #render_success

Instance Method Details

#createObject



5
6
7
8
9
10
11
12
13
# File 'app/controllers/educode_sales/customer_follows_controller.rb', line 5

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

#destroyObject



15
16
17
18
19
20
21
22
# File 'app/controllers/educode_sales/customer_follows_controller.rb', line 15

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

#updateObject



24
25
26
27
28
29
30
31
32
# File 'app/controllers/educode_sales/customer_follows_controller.rb', line 24

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