Class: Framey::VideosController

Inherits:
ApplicationController
  • Object
show all
Defined in:
lib/rails/generators/framey/templates/videos_controller.rb

Instance Method Summary collapse

Instance Method Details

#callbackObject

framey callback



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/rails/generators/framey/templates/videos_controller.rb', line 11

def callback
  render :text => "" and return unless request.post? && params[:video]

  video = Video.create!({
    :name => params[:video][:name],
    :filesize => params[:video][:filesize],
    :duration => params[:video][:duration],
    :state => params[:video][:state],
    :views => params[:video][:views],
    :flv_url => params[:video][:flv_url],
    :mp4_url => params[:video][:mp4_url],
    :small_thumbnail_url => params[:video][:small_thumbnail_url],
    :medium_thumbnail_url => params[:video][:medium_thumbnail_url],          
    :large_thumbnail_url => params[:video][:large_thumbnail_url]
  })

  render :text => "" and return
end

#indexObject



30
31
32
33
# File 'lib/rails/generators/framey/templates/videos_controller.rb', line 30

def index
  @videos = Framey::Video.all
  
end

#newObject



6
7
8
# File 'lib/rails/generators/framey/templates/videos_controller.rb', line 6

def new

end

#showObject



35
36
37
# File 'lib/rails/generators/framey/templates/videos_controller.rb', line 35

def show
  @video = Framey::Video.find_by_name(params[:id])
end