Class: Framey::VideosController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Framey::VideosController
- Defined in:
- app/controllers/framey/videos_controller.rb
Instance Method Summary collapse
-
#callback ⇒ Object
framey callback.
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
Instance Method Details
#callback ⇒ Object
framey callback
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'app/controllers/framey/videos_controller.rb', line 13 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 |
#index ⇒ Object
32 33 34 35 |
# File 'app/controllers/framey/videos_controller.rb', line 32 def index @videos = Framey::Video.paginate(:page => params[:page], :per_page => 10).order('created_at DESC') end |
#new ⇒ Object
8 9 10 |
# File 'app/controllers/framey/videos_controller.rb', line 8 def new end |
#show ⇒ Object
37 38 39 |
# File 'app/controllers/framey/videos_controller.rb', line 37 def show @video = Framey::Video.find_by_name(params[:id]) end |