Sha256: 57fd42cb69f46070ee76099a56edf5d8b75a0db4c8996b3b7a45009a796a61b7

Contents?: true

Size: 327 Bytes

Versions: 2

Compression:

Stored size: 327 Bytes

Contents

module VoltronHelper

  def voltron_include_tag
    javascript_tag "Voltron.initialize(#{voltron_config_json});", type: 'text/javascript'
  end

  def voltron_config_json
    Voltron.config.to_h.merge({ controller: controller_name, action: action_name, auth_token: try(:form_authenticity_token) }).to_json.html_safe
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
voltron-0.3.2 app/helpers/voltron_helper.rb
voltron-0.3.1 app/helpers/voltron_helper.rb