GitLab steht wegen Wartungsarbeiten am Montag, den 10. Mai, zwischen 17:00 und 19:00 Uhr nicht zur Verfügung.

hooks_helper.rb 520 Bytes
Newer Older
1 2
# frozen_string_literal: true

3 4 5 6 7 8 9 10 11 12 13 14
module HooksHelper
  def link_to_test_hook(hook, trigger)
    path = case hook
           when ProjectHook
             project = hook.project
             test_project_hook_path(project, hook, trigger: trigger)
           when SystemHook
             test_admin_hook_path(hook, trigger: trigger)
           end

    trigger_human_name = trigger.to_s.tr('_', ' ').camelize

15
    link_to path, rel: 'nofollow', method: :post do
16 17 18 19
      content_tag(:span, trigger_human_name)
    end
  end
end