Module: CMS::JavascriptHelper

Defined in:
app/helpers/cms/javascript_helper.rb

Instance Method Summary collapse

Instance Method Details

#cms_data_js(name, data = true, options = {}) ⇒ Object



3
4
5
# File 'app/helpers/cms/javascript_helper.rb', line 3

def cms_data_js(name, data = true, options = {})
  { "data-js-#{name}" => data.to_json }.merge(options)
end

#cms_data_js_html(name, data = true, options = {}) ⇒ Object



7
8
9
# File 'app/helpers/cms/javascript_helper.rb', line 7

def cms_data_js_html(name, data = true, options = {})
  CMS.options_to_html cms_data_js(name, data, options)
end