Module: CopyHelper

Defined in:
lib/helpers/copy_helper.rb

Instance Method Summary collapse

Instance Method Details

#copy_button(button_name, to_copy_text, html_options) ⇒ Object



3
4
5
6
7
8
# File 'lib/helpers/copy_helper.rb', line 3

def copy_button(button_name, to_copy_text, html_options)
	html_options[:class] = "#{html_options[:class]} zeroclipboard_clip_button"
	html_attrs = html_options.map{|k, v| "#{k.to_s}=\"#{v.to_s}\"" }.join(" ")
	#<script type=\"text/javascript\" src=\"zeroclipboard/ZeroClipboard.js\"></script>
  raw "<a #{html_attrs} data-links=\"#{to_copy_text}\">#{button_name}</a>"
end