Class: Dashing::WidgetsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/dashing/widgets_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject



10
11
12
# File 'app/controllers/dashing/widgets_controller.rb', line 10

def show
  render file: widget_path, layout: false
end

#updateObject



14
15
16
17
18
19
20
21
22
# File 'app/controllers/dashing/widgets_controller.rb', line 14

def update
  data = params[:widget] || {}
  hash = data.merge(id: params[:name], updatedAt: Time.now.utc.to_i)
  Dashing.redis.with do |redis_connection|
    redis_connection.publish("#{Dashing.config.redis_namespace}.create", hash.to_json)
  end

  render nothing: true
end