Class: Crm::Scheduler::ProfilesController
- Inherits:
-
CrmController
- Object
- CrmController
- Crm::Scheduler::ProfilesController
- Defined in:
- app/controllers/crm/scheduler/profiles_controller.rb
Overview
Availability settings for SchedulerProfile records (buffers, timezone,
whether an employee is bookable at all).
Instance Method Summary collapse
-
#edit ⇒ void
Redirects to the employee's Scheduler tab, where availability is edited in place.
-
#index ⇒ void
Lists scheduler profiles by employee name.
-
#update ⇒ void
Updates the profile loaded by #find_profile and returns to the employee's Scheduler tab.
Instance Method Details
#edit ⇒ void
This method returns an undefined value.
Redirects to the employee's Scheduler tab, where availability is
edited in place.
19 20 21 |
# File 'app/controllers/crm/scheduler/profiles_controller.rb', line 19 def edit redirect_to employee_path(@profile.employee, tab: 'scheduler') end |
#index ⇒ void
This method returns an undefined value.
Lists scheduler profiles by employee name.
11 12 13 |
# File 'app/controllers/crm/scheduler/profiles_controller.rb', line 11 def index @profiles = SchedulerProfile.includes(employee: :employee_record).order('parties.full_name') end |
#update ⇒ void
This method returns an undefined value.
Updates the profile loaded by #find_profile and returns to the
employee's Scheduler tab.
27 28 29 30 31 32 33 |
# File 'app/controllers/crm/scheduler/profiles_controller.rb', line 27 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..to_sentence end end |