href should not contain space

This commit is contained in:
simon lehericey 2019-11-20 17:22:01 +01:00
parent 1bba20a782
commit f45ede7f44
4 changed files with 9 additions and 3 deletions

View file

@ -30,4 +30,10 @@ class Service < ApplicationRecord
service_cloned.administrateur = administrateur
service_cloned
end
def telephone_url
if telephone.present?
"tel:#{telephone.gsub(/[[:blank:]]/, '')}"
end
end
end

View file

@ -28,7 +28,7 @@
= link_to service.email, "mailto:#{service.email}"
%br
Par téléphone :
= link_to service.telephone, "tel:#{service.telephone}"
= link_to service.telephone, service.telephone_url
%br
Horaires : #{ formatted_horaires(service.horaires) }

View file

@ -9,7 +9,7 @@
= link_to service.email, "mailto:#{service.email}"
%p.help-dropdown-service-item
%span.icon.small.phone
= link_to service.telephone, "tel:#{service.telephone}"
= link_to service.telephone, service.telephone_url
%p.help-dropdown-service-item
%span.icon.small.clock
= service.horaires

View file

@ -24,7 +24,7 @@
%li
Par téléphone :
%a{ href: "tel:#{service.telephone}" }= service.telephone
= link_to service.telephone, service.telephone_url
%li
- horaires = "Horaires : #{formatted_horaires(service.horaires)}"