5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'app/controllers/cms/inline_content_controller.rb', line 5
def update
content_block = Content.find_draft(params[:content_name], params[:id])
content_block.update_attributes(filtered_content(content_block))
@page = Page.find_draft(params[:page_id].to_i)
if (!@page.live?)
page_status = "draft"
status_label = "This page is in draft status"
else
page_status = "published"
status_label = "Published"
end
routes = []
if params[:container]
connectors = @page.current_connectors(params[:container].to_sym)
connectors.each do |c|
routes << {
move_up: cms.move_up_connector_path(c, format: :json),
move_down: cms.move_down_connector_path(c, format: :json),
remove: cms.connector_path(c, format: :json)
}
end
end
results = {
page_status: page_status,
status_label: status_label,
page_title: @page.title,
container: params[:container].to_s,
routes: routes
}
render json: results, layout: false
end
|