Module: Gon::ViewHelpers

Defined in:
lib/gon/helpers.rb

Instance Method Summary collapse

Instance Method Details

#include_gon(options = {}) ⇒ Object



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

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



14
15
16
# File 'lib/gon/helpers.rb', line 14

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