add home delete

This commit is contained in:
bee0005
2016-09-23 13:45:20 +00:00
parent 1b7b26ee06
commit bd8cd1d48d
4 changed files with 29 additions and 10 deletions

View File

@@ -27,14 +27,16 @@ class HomeController < ApplicationController
`#{command}`
redirect_to '/home/index'
end
def delete_file
file_name = params[:file_name]
# delete file
command = String.new
command << "sudo rm -rf #{file_name}"
puts command
`#{command}`
`#{command}`
redirect_to '/home/index'
end
end