Sha256: 53faa6cb896e4ab1f776a5d01775e8686137ab9955aa1568be1e48fabe41376f

Contents?: true

Size: 845 Bytes

Versions: 1

Compression:

Stored size: 845 Bytes

Contents

class PagesController < ApplicationController
  include JquerySortableTreeController::Rebuild
  include JquerySortableTreeController::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 indented_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) if @root
    render template: 'pages/manage'
  end

  def expand
    @pages = Page.nested_set.roots.select('id, title, content, parent_id')
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jquery_sortable_tree-3.0.0 spec/dummy_app/app/controllers/pages_controller.rb