Sha256: b4afc5cbdc244c5d9aa9e9b040fceec47d6b68115ecb3ab6a92ca2e78e7e64c9

Contents?: true

Size: 409 Bytes

Versions: 17

Compression:

Stored size: 409 Bytes

Contents

module EvilFront::Helpers
  # Render link with phone number. It will remove all non-digits symbols from
  # phone number and format `tel:` protocol URI.
  #
  #   label Contact us:
  #   = tel('+7 (495) 660−83−79')
  def tel(number, args = { })
    args[:href]  = "tel:" + number.gsub(/[^\d\+]/, '')
    args[:class] = (['tel', args[:class]]).compact.join(' ')
    content_tag(:a, number, args)
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
evil-front-0.5.1 lib/evil-front/helpers/tel.rb
evil-front-0.5.0 lib/evil-front/helpers/tel.rb
evil-front-0.4.0 lib/evil-front/helpers/tel.rb
evil-front-0.3.10 lib/evil-front/helpers/tel.rb
evil-front-0.3.9 lib/evil-front/helpers/tel.rb
evil-front-0.3.8 lib/evil-front/helpers/tel.rb
evil-front-0.3.7 lib/evil-front/helpers/tel.rb
evil-front-0.3.6 lib/evil-front/helpers/tel.rb
evil-front-0.3.5 lib/evil-front/helpers/tel.rb
evil-front-0.3.4 lib/evil-front/helpers/tel.rb
evil-front-0.3.3 lib/evil-front/helpers/tel.rb
evil-front-0.3.2 lib/evil-front/helpers/tel.rb
evil-front-0.3.1 lib/evil-front/helpers/tel.rb
evil-front-0.3.0 lib/evil-front/helpers/tel.rb
evil-front-0.2.1 lib/evil-front/helpers/tel.rb
evil-front-0.2.0 lib/evil-front/helpers/tel.rb
evil-front-0.1.0 lib/evil-front/helpers/tel.rb