diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 72f9e47..3a5a781 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -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 diff --git a/app/helpers/home_helper.rb b/app/helpers/home_helper.rb index 23de56a..475f4fc 100644 --- a/app/helpers/home_helper.rb +++ b/app/helpers/home_helper.rb @@ -1,2 +1,3 @@ module HomeHelper + end diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index c8907b8..bf418e4 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -143,7 +143,10 @@ <% end %>