Sha256: 718d744394971dcead0e0b9603bdca32f8fe9ca5b613ee62389b6915f913d48b

Contents?: true

Size: 1.04 KB

Versions: 4

Compression:

Stored size: 1.04 KB

Contents

module Framey
  class VideosController < ApplicationController
    
    layout 'framey'  # this allows you to have a gem-wide layout
    
    def new
    
    end
    
    # framey callback
    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
    
    def index
      @videos = Framey::Video.all
      
    end
    
    def show
      @video = Framey::Video.find_by_name(params[:id])
    end
    
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
framey-1.2.7 lib/rails/generators/framey/templates/videos_controller.rb
framey-1.2.5 lib/rails/generators/framey/templates/videos_controller.rb
framey-1.2.4 lib/rails/generators/framey/templates/videos_controller.rb
framey-1.2.3 lib/rails/generators/framey/templates/videos_controller.rb