catch for directory edit attempt

This commit is contained in:
Kyle Drake 2014-12-28 12:51:47 -06:00
parent 9874ce3c5f
commit 4e847e2295

View file

@ -115,6 +115,9 @@ get %r{\/site_files\/text_editor\/(.+)} do
rescue Errno::ENOENT
flash[:error] = 'We could not find the requested file.'
redirect '/dashboard'
rescue Errno::EISDIR
flash[:error] = 'Cannot edit a directory.'
redirect '/dashboard'
end
erb :'site_files/text_editor'
end