9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'app/controllers/panda_cms/admin/settings/bulk_editor_controller.rb', line 9
def create
begin
debug_output = BulkEditor.import(params[:site_content])
rescue JSON::ParserError
redirect_to admin_settings_bulk_editor_path, flash: {error: "Error parsing content; are you sure this update is valid? Reverting..."}
return
end
@json_data = BulkEditor.export
if debug_output[:error].empty? && debug_output[:warning].empty? && debug_output[:success].empty?
redirect_to admin_settings_bulk_editor_path, flash: {success: "No changes were found!"}
else
@debug = debug_output
render :new, flash: {warning: "Please review the output below for more information."}
end
end
|