Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sortable_nested_set

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sortable_nested_set

  • 0.4.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

= Sortable Nested Set

== Requirements

jQuery is required.

== Usage

Add the gem to your Gemfile.

gem 'sortable_nested_set'

In each "Category" (e.g. "Directory") migration: lft:integer rgt:integer depth:integer [optional]

In the routing configuration file: nest the "Category" and "Item" resources

In the "Category" and "Item" controllers: [new] use param[:category_id] [destroy] respond_to format.js (and provide associated view)

In the "Category" and "Items" models: provide #to_s.

In the section of the layout(s) where the trees will be displayed: yield(:head) after jQuery is loaded.

In each "Category" model: acts_as_sortable_nested_set_of :items where :items is the pluralized, underscored "Item" model (e.g. "ImageFile"=>:image_files).

== Options

:order specifies the order which "Items" will be sorted in. Defaults to nil unless "Item" acts_as_list.

== Support for acts_as_list

When an "Item" model acts_as_list, SortableNestedSet will automatically use its position for sorting.

== Helpers

sns_options sns_lineage sns_tree

FAQs

Package last updated on 28 Feb 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc