New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ancestry-treeview

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ancestry-treeview

  • 0.0.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

ancestry-treeview Build Status Dependency Status

testing ruby: 1.9.3, 2.0.0; ancestry: 2.0.0

ancestry-treeview is an extension of ancestry gem to show a tree view which looks like http://jsfiddle.net/Fh47n/.

Install

gem install ancestry-treeview

Usage

Basic Usage

Add the following code in your app/assets/stylesheets/application.css.scss

@import "ancestry-treeview";

Then, call

node.tree

in your view where node is your ancestry model.

Default html links in the tree view are as

<a href="#">id</a>

You can change the html link by giving a block as

node.tree {|node| link_to("text", your_controller_path(node)) }

Contraint Depth

As default, all childrens of a node is shown as a tree. Use to_depth option to contraint the depth

node.tree(to_depth: 1)

Acknowledgements

I appreciate Vitaliy Bychik for giving such a nice css style at http://stackoverflow.com/questions/11167628/trees-in-twitter-bootstrap .

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Copyright (c) 2013 Naotoshi SEO. See LICENSE for details.

FAQs

Package last updated on 01 Jul 2013

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