Module: TelLinkRails::ViewHelper
- Defined in:
- lib/tel_link_rails/view_helper.rb
Instance Method Summary collapse
Instance Method Details
#tel_link(number, name = nil, html_options = {}, &block) ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/tel_link_rails/view_helper.rb', line 4 def tel_link(number, name = nil, = {}, &block) sets_of_numbers = number.scan(/[\+0-9]+/) num = "#{sets_of_numbers.join('-')}" ['href'] = "tel:#{num}" content_tag(:a, name || number, , &block) end |