Cleanup contact_link helper

This commit is contained in:
Paul Chavard 2018-08-30 14:10:18 +01:00
parent 8e88f2c27f
commit 5d5a356ade

View file

@ -55,12 +55,11 @@ module ApplicationHelper
end end
def contact_link(title, options = {}) def contact_link(title, options = {})
tags, type, dossier_id = options.values_at(:tags, :type, :dossier_id)
options.except!(:tags, :type, :dossier_id)
if Flipflop.support_form? if Flipflop.support_form?
params = { params = { tags: tags, type: type, dossier_id: dossier_id }.compact
tags: options[:tags],
type: options[:type],
dossier_id: options[:dossier_id]
}.compact
link_to title, contact_url(params), options link_to title, contact_url(params), options
else else
mail_to CONTACT_EMAIL, title, mail_to CONTACT_EMAIL, title,