Sha256: edcb15d4c9c9c9659f29633067bebb169187da906e29cdf89c421cbdf26de77e
Contents?: true
Size: 836 Bytes
Versions: 3
Compression:
Stored size: 836 Bytes
Contents
class PagesController < ApplicationController include JquerySortableTreeController::Rebuild include JquerySortableTreeController::ExpandNode before_action :load_pages, only: [:index, :nested_options, :indented_options, :optgroup] def index end def nested_options end def indented_options end def optgroup end def manage @pages = Page.nested_set.select('id, title, content, parent_id').all end def node_manage @root = Page.root @pages = @root.self_and_descendants.nested_set.select('id, title, content, parent_id').limit(15) if @root render template: 'pages/manage' end def expand @pages = Page.nested_set.roots.select('id, title, content, parent_id') end private def load_pages @pages = Page.nested_set.select('id, title, content, parent_id').limit(15) end end
Version data entries
3 entries across 3 versions & 1 rubygems