From 243b33810bae7339052c5c8c4a10f8a1cec638a2 Mon Sep 17 00:00:00 2001 From: Rick Barrette Date: Mon, 7 Jan 2013 10:48:21 -0500 Subject: [PATCH] Fixed Deleting Of Maps --- app/controllers/maps_controller.rb | 2 +- config/routes.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/maps_controller.rb b/app/controllers/maps_controller.rb index 4cbf858..e231fcc 100755 --- a/app/controllers/maps_controller.rb +++ b/app/controllers/maps_controller.rb @@ -39,7 +39,7 @@ class MapsController < ApplicationController if map != nil map.destroy directory = "public/maps" - File.delete("#{RAILS_ROOT}/public/maps/#{params[:map]}") + File.delete("#{Rails.root}/public/maps/#{params[:map]}") flash.now[:notice] = "Map deleted successfully" else flash.now[:error] = "No Map Found" diff --git a/config/routes.rb b/config/routes.rb index 70ee00a..e56e130 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -25,7 +25,7 @@ if Rails::VERSION::MAJOR >= 3 match 'exceptionhandler', :to => 'exceptionhandler#index', :via => [:get, :post] match '/exceptionhandler/maps', :to => 'maps#index', :via => [:get, :post] match '/uploadFile', :to => 'maps#uploadFile', :via => :post - match '/exceptionhandler/maps/delete/:map', :to => 'maps#deleteMap', :via => :post + match '/exceptionhandler/delete/:map', :to => 'maps#deleteMap', :via => :post match '/exceptionhandler/maps/new', :to => 'maps#new', :via => [:get, :post] end else