Module: Chartkick::Remote::ClassMethods

Defined in:
lib/chartkick/remote/remote.rb

Instance Method Summary collapse

Instance Method Details

#chartkick_remote(options = {}) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/chartkick/remote/remote.rb', line 28

def chartkick_remote(options = {})
  options = options.dup

  action_filter_options = options.extract!(:only, :except)

  respond_to :json, action_filter_options

  self.responder = Class.new(responder) do
    include Responder
  end

  before_filter action_filter_options do
    self.chartkick_options = self.class.chartkick_options
  end

  self.chartkick_options = {remote: true}.merge(options)
end