Sha256: 1bdb6c2413b2882cf6d26ec4cc58125d49320d0962b93de83d34d2e4034407ec

Contents?: true

Size: 734 Bytes

Versions: 7

Compression:

Stored size: 734 Bytes

Contents

class Admin::PagesController < ApplicationController
  include TheSortableTreeController::Rebuild

  def index
    @pages = Admin::Page.nested_set.select('id, title, content, parent_id').limit(15)
  end

  def manage
    @pages = Admin::Page.nested_set.select('id, title, content, parent_id').limit(15)
  end

  def nested_options
    @pages = Admin::Page.nested_set.select('id, title, content, parent_id').limit(15)
  end

  def node_manage
    @root  = Admin::Page.root
    @pages = @root.self_and_descendants.nested_set.select('id, title, content, parent_id').limit(15)
    render template: 'admin/pages/manage'
  end

  protected 

  def sortable_model
    Admin::Page
  end

  def sortable_collection
    'admin_pages'
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
the_sortable_tree-2.6.2 spec/dummy_app/app/controllers/admin/pages_controller.rb
the_sortable_tree-2.7.0 spec/dummy_app/app/controllers/admin/pages_controller.rb
the_sortable_tree-2.6.1 spec/dummy_app/app/controllers/admin/pages_controller.rb
the_sortable_tree-2.6.0 spec/dummy_app/app/controllers/admin/pages_controller.rb
the_sortable_tree-2.5.0 spec/dummy_app/app/controllers/admin/pages_controller.rb
the_sortable_tree-2.4.0 spec/dummy_app/app/controllers/admin/pages_controller.rb
the_sortable_tree-2.3.3 spec/the_sortable_tree_app/app/controllers/admin/pages_controller.rb