delete btn for menu item instance
This commit is contained in:
@@ -126,14 +126,15 @@ class Settings::SimpleMenuItemsController < ApplicationController
|
||||
|
||||
# DELETE /settings/menu_items/1
|
||||
# DELETE /settings/menu_items/1.json
|
||||
def destroy
|
||||
def destroy
|
||||
path_to_file = @settings_menu_item.image_path.to_s
|
||||
File.delete(path_to_file) if File.exist?(path_to_file)
|
||||
abc = MenuItem.deleteRecursive(@settings_menu_item)
|
||||
respond_to do |format|
|
||||
format.html { redirect_to settings_menu_category_simple_menu_items_path, notice: 'Menu item was successfully destroyed.' }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
render :json => {:status=> "Success", :url => settings_menu_category_simple_menu_items_path }.to_json
|
||||
# respond_to do |format|
|
||||
# format.html { redirect_to settings_menu_category_simple_menu_items_path, notice: 'Menu item was successfully destroyed.' }
|
||||
# format.json { head :no_content }
|
||||
# end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
Reference in New Issue
Block a user