Module: SpiffEnrollmentsHelper

Defined in:
app/helpers/spiff_enrollments_helper.rb

Overview

== Schema Information

Table name: spiff_enrollments

id :integer not null, primary key
contact_id :integer
spiff_id :integer
enrollment_date :date
creator_id :integer
updater_id :integer
created_at :datetime
updated_at :datetime
payable_to_id :integer
mailing_address_id :integer
unenrollment_date :date
notification_email :string(255)
start_date :date
end_date :date

Instance Method Summary collapse

Instance Method Details

#spiff_enrollment_command_options(spiff_enrollment, contact) ⇒ Object



22
23
24
25
26
27
28
29
30
# File 'app/helpers/spiff_enrollments_helper.rb', line 22

def spiff_enrollment_command_options(spiff_enrollment, contact)
  [].tap do |opts|
   	opts << link_to("Edit", edit_spiff_enrollment_path(spiff_enrollment))
		unless spiff_enrollment.unenrollment_date.present?
			opts << link_to("Make Active", make_active_spiff_enrollment_path(spiff_enrollment), data: { turbo_method: :post }) unless spiff_enrollment == contact.active_spiff_enrollment
			opts << link_to("Unenroll", unenroll_spiff_enrollment_path(spiff_enrollment), data: { turbo_confirm: "Are you sure?", turbo_method: :post })
		end
  end
end