Sha256: 7937da2206de3d160257225bbe8031133576166ba78f7eacb4303f3ce80aaeac
Contents?: true
Size: 721 Bytes
Versions: 5
Compression:
Stored size: 721 Bytes
Contents
class PagesController < ApplicationController include TheSortableTreeController::Rebuild include TheSortableTreeController::ExpandNode def index @pages = Page.nested_set.select('id, title, content, parent_id').limit(15) end def nested_options @pages = Page.nested_set.select('id, title, content, parent_id').limit(15) 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) render template: 'pages/manage' end def expand @pages = Page.nested_set.roots.select('id, title, content, parent_id') end end
Version data entries
5 entries across 5 versions & 1 rubygems