Sha256: 5e3ba784c3de3b5733d81bfc3247d8d0e2c222306125265b649fd29bc70eaf57

Contents?: true

Size: 542 Bytes

Versions: 2

Compression:

Stored size: 542 Bytes

Contents

require 'action_view/helpers'

module ActionView
  module Helpers
    # = Action View Telephone Link Helper
    module TelToHelper
      # 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.
      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
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
tel_to_helper-0.0.3 lib/action_view/helpers/tel_to_helper.rb
rails-tel_to_helper-0.0.2 lib/action_view/helpers/tel_to_helper.rb