Module: Tosspayments2::Rails::ScriptTagHelper
- Defined in:
- lib/tosspayments2/rails/script_tag_helper.rb
Instance Method Summary collapse
Instance Method Details
#tosspayments_script_tag(async: true, defer: true, version: nil) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/tosspayments2/rails/script_tag_helper.rb', line 8 def tosspayments_script_tag(async: true, defer: true, version: nil) v = version || ::Tosspayments2::Rails.configuration. src = "https://js.tosspayments.com/#{v}/standard" attrs = [] attrs << 'async' if async attrs << 'defer' if defer attrs << %(src="#{ERB::Util.html_escape(src)}") "<script #{attrs.join(' ')}></script>".html_safe end |