Sha256: 4ab4101057675a0c44aca2bd3dbe2fc1e51e60170456c3be5c15e0f165388f83
Contents?: true
Size: 813 Bytes
Versions: 11
Compression:
Stored size: 813 Bytes
Contents
module Cms class SectionNodesController < Cms::BaseController check_permissions :publish_content, :except => [:index] 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 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 end end
Version data entries
11 entries across 11 versions & 2 rubygems