Class: Crm::Customers::OnboardingController
- Inherits:
-
CrmController
- Object
- CrmController
- Crm::Customers::OnboardingController
- Defined in:
- app/controllers/crm/customers/onboarding_controller.rb
Overview
Controller: onboarding.
Instance Method Summary collapse
-
#edit ⇒ Object
Renders the customer's onboarding form (templates + contact points).
-
#show ⇒ Object
Lists a customer's exported catalog item packets, ransack-filtered (defaulting to active packets only).
-
#update ⇒ Object
Updates the customer's onboarding record from
onboarding_params.
Instance Method Details
#edit ⇒ Object
Renders the customer's onboarding form (templates + contact points).
16 17 18 19 20 |
# File 'app/controllers/crm/customers/onboarding_controller.rb', line 16 def edit (:manage, ExportedCatalogItemPacket) load_customer_record prepare_contact_points end |
#show ⇒ Object
Lists a customer's exported catalog item packets, ransack-filtered
(defaulting to active packets only).
6 7 8 9 10 11 12 13 |
# File 'app/controllers/crm/customers/onboarding_controller.rb', line 6 def show (:manage, ExportedCatalogItemPacket) load_customer_record params[:q] ||= { inactive_eq: 0 } @q = @customer.exported_catalog_item_packets.ransack(params[:q]) @q.sorts = 'updated_at DESC' if @q.sorts.blank? @pagy, @packets = pagy(@q.result, limit: params[:per]) end |
#update ⇒ Object
Updates the customer's onboarding record from onboarding_params.
23 24 25 26 27 28 29 30 31 |
# File 'app/controllers/crm/customers/onboarding_controller.rb', line 23 def update (:manage, ExportedCatalogItemPacket) load_customer_record if @customer_record.update(onboarding_params) redirect_to_return_path_or_default customer_onboarding_path(@customer) else render :edit, status: :unprocessable_content end end |