Class: Crm::Scheduler::ProfilesController

Inherits:
CrmController
  • Object
show all
Defined in:
app/controllers/crm/scheduler/profiles_controller.rb

Instance Method Summary collapse

Instance Method Details

#editObject



10
11
12
# File 'app/controllers/crm/scheduler/profiles_controller.rb', line 10

def edit
  redirect_to employee_path(@profile.employee, tab: 'scheduler')
end

#indexObject



6
7
8
# File 'app/controllers/crm/scheduler/profiles_controller.rb', line 6

def index
  @profiles = SchedulerProfile.includes(employee: :employee_record).order('parties.full_name')
end

#updateObject



14
15
16
17
18
19
20
# File 'app/controllers/crm/scheduler/profiles_controller.rb', line 14

def update
  if @profile.update(profile_params)
    redirect_to employee_path(@profile.employee, tab: 'scheduler'), notice: 'Availability updated.'
  else
    redirect_to employee_path(@profile.employee, tab: 'scheduler'), alert: @profile.errors.full_messages.to_sentence
  end
end