Class: Cms::SectionNodesController

Inherits:
BaseController show all
Defined in:
app/controllers/cms/section_nodes_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

allow_guests_to

Methods inherited from ApplicationController

#no_browser_caching

Instance Method Details

#indexObject



6
7
8
9
10
11
12
13
14
# File 'app/controllers/cms/section_nodes_controller.rb', line 6

def index
  @modifiable_sections = current_user.modifiable_sections
  @public_sections = Group.guest.sections.to_a # Load once here so that every section doesn't need to.

  @sitemap = Section.sitemap
  @root_section_node = @sitemap.keys.first
  @section = @root_section_node.node
  render 'show'
end

#move_to_positionObject



16
17
18
19
20
21
# File 'app/controllers/cms/section_nodes_controller.rb', line 16

def move_to_position
  @section_node = SectionNode.find(params[:id])
  target_node = SectionNode.find(params[:target_node_id])
  @section_node.move_to(target_node.node, params[:position].to_i)
  render :json => {:success => true, :message => "'#{@section_node.node.name}' was moved to '#{target_node.node.name}'"}
end