Class: Panda::CMS::Admin::Settings::BulkEditorController
- Inherits:
-
BaseController
- Object
- Panda::Core::Admin::BaseController
- BaseController
- Panda::CMS::Admin::Settings::BulkEditorController
show all
- Defined in:
- app/controllers/panda/cms/admin/settings/bulk_editor_controller.rb
Instance Method Summary
collapse
#set_current_request_details
#active_link?, #block_link_to, #component, #level_indent, #menu_indent, #nav_class, #nav_highlight_colour_classes, #panda_cms_collection, #panda_cms_collection_items, #panda_cms_editor, #panda_cms_feature_enabled?, #panda_cms_form_with, #selected_nav_highlight_colour_classes, #table_indent, #title_tag
Instance Method Details
#create ⇒ Object
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'app/controllers/panda/cms/admin/settings/bulk_editor_controller.rb', line 14
def create
begin
debug_output = BulkEditor.import(params[:site_content])
rescue JSON::ParserError
redirect_to admin_cms_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_cms_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
|
#new ⇒ Object
10
11
12
|
# File 'app/controllers/panda/cms/admin/settings/bulk_editor_controller.rb', line 10
def new
@json_data = BulkEditor.export
end
|