Created
March 11, 2012 17:45
-
-
Save Znow/2017360 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class VideosController < ApplicationController | |
before_filter :authenticate_user!, :except => [:index, :show] | |
load_and_authorize_resource | |
def index | |
@videos = Panda::Encoding.all | |
#Panda.get('/videos.json') | |
end | |
def show | |
@video = Video.find(params[:id]) | |
@original_video = @video.panda_video | |
@h264_encoding = @original_video.encodings['h264'] | |
end | |
def new | |
@video = Video.new | |
end | |
def create | |
@video = Video.create!(params[:video]) | |
redirect_to :action => :show, :id => @video.id | |
end | |
def destroy | |
@video = Video.find(params[:id]) | |
@video.destroy | |
redirect_to videos_path, :notice => "Video blev slettet." | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment