Module: ActionView::Helpers::TelToHelper

Defined in:
lib/action_view/helpers/tel_to_helper.rb

Overview

Action View Telephone Link Helper

Instance Method Summary collapse

Instance Method Details

#tel_to(number, name = nil, link_to_options = nil) ⇒ Object

Creates a telephone link tag of the given number and name. If nil is passed as the name the value of the link itself will become the number. options and html_options will be same as +link_to.



10
11
12
# File 'lib/action_view/helpers/tel_to_helper.rb', line 10

def tel_to(number, name = nil, link_to_options = nil)
  link_to(h(name || number), "tel:#{h(number)}", link_to_options) if number.present?
end