obdev/app/helpers/onboardings_helper.rb

16 lines
473 B
Ruby

module OnboardingsHelper
def submit_onboarding_polymorphic_path(owner)
case owner
when Participant
submit_onboarding_participant_onboardings_path(owner)
when Worker
submit_onboarding_worker_onboardings_path(owner)
when Vendor
submit_onboarding_vendor_onboardings_path(owner)
when Employer
submit_onboarding_employer_onboardings_path(owner)
else
root_path # Default path if owner type is unrecognized
end
end
end