Fixed Deleting Of Maps

This commit is contained in:
2013-01-07 10:48:21 -05:00
parent b9a084cf16
commit 243b33810b
2 changed files with 2 additions and 2 deletions

View File

@@ -39,7 +39,7 @@ class MapsController < ApplicationController
if map != nil if map != nil
map.destroy map.destroy
directory = "public/maps" 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" flash.now[:notice] = "Map deleted successfully"
else else
flash.now[:error] = "No Map Found" flash.now[:error] = "No Map Found"

View File

@@ -25,7 +25,7 @@ if Rails::VERSION::MAJOR >= 3
match 'exceptionhandler', :to => 'exceptionhandler#index', :via => [:get, :post] match 'exceptionhandler', :to => 'exceptionhandler#index', :via => [:get, :post]
match '/exceptionhandler/maps', :to => 'maps#index', :via => [:get, :post] match '/exceptionhandler/maps', :to => 'maps#index', :via => [:get, :post]
match '/uploadFile', :to => 'maps#uploadFile', :via => :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] match '/exceptionhandler/maps/new', :to => 'maps#new', :via => [:get, :post]
end end
else else