Module: Gon::ViewHelpers

Defined in:
lib/gon/helpers.rb

Instance Method Summary collapse

Instance Method Details

#include_gon(options = {}) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/gon/helpers.rb', line 5

def include_gon(options = {})
  if variables_for_request_present?
    Gon::Base.render_data(options)
  elsif Gon.global.all_variables.present? || options[:init].present?
    Gon.clear
    Gon::Base.render_data(options)
  else
    ''
  end
end

#include_gon_amd(options = {}) ⇒ Object



16
17
18
# File 'lib/gon/helpers.rb', line 16

def include_gon_amd(options={})
  Gon::Base.render_data(options.merge({amd: true}))
end