Class: CloudhdrController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/cloudhdr_controller.rb

Instance Method Summary collapse

Instance Method Details

#cloudhdr_notification_updateObject



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'app/controllers/cloudhdr_controller.rb', line 5

def cloudhdr_notification_update
  full_params = params
  puts "cloudhdr_notification_update"
  puts params
  puts "request.raw_post-------------------------------------------------------"
  puts request.raw_post
  puts "request.body.read-------------------------------------------------------"
  puts request.body.read
  CloudhdrJob.update_from_cloudhdr(full_params)
  respond_to do |format|
    format.json  { render :json => {} }
  end
end

#multi_thumbnail_updateObject



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'app/controllers/cloudhdr_controller.rb', line 28

def multi_thumbnail_update
  @outputs = []
  params[:images].each do |image|
    # Format ex : Image_1_medium_db0ce8ba5d55c25eee7c767220d654fe
    # Format is : class_id_thumbnail_random
    match = image.match(/^(.*)_(.*)_(.*)_(.*)$/)
    hash = { 
      :elem_id     => image,
      :class_name  => match[1],
      :id          => match[2],
      :thumbnail   => match[3],
      :random      => match[4],
      :image       => Kernel.const_get(match[1]).find(match[2]) 
    }
    @outputs << hash
  end
  respond_to do |format|
    format.json {}
  end
end

#thumbnail_updateObject



19
20
21
22
23
24
25
26
# File 'app/controllers/cloudhdr_controller.rb', line 19

def thumbnail_update
  @img = Kernel.const_get(params[:class]).find params[:id]
  @random = params[:random]
  @live_vide = params[:live_video]
  respond_to do |format|
    format.js {}
  end
end