Added ability to delete videos
This commit is contained in:
parent
89ebf5c792
commit
a2f2224b96
@ -1,3 +1,5 @@
|
||||
require 'fileutils'
|
||||
|
||||
namespace '/video' do
|
||||
|
||||
get '' do
|
||||
@ -93,6 +95,15 @@ namespace '/video' do
|
||||
redirect "/video/#{video.id}"
|
||||
end
|
||||
|
||||
get '/:video_id/delete' do
|
||||
# find the video and delete it
|
||||
video = Video.where(id: params[:video_id]).first()
|
||||
FileUtils.rm_rf(video.directory_path)
|
||||
video.delete()
|
||||
|
||||
redirect '/video'
|
||||
end
|
||||
|
||||
get '/:video_id/edit/script' do
|
||||
video = Video.where(id: params[:video_id]).first()
|
||||
erb :'video/edit-script', :locals => {
|
||||
|
Loading…
Reference in New Issue
Block a user