Fixed Deleting Of Maps
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user