Browse the Ruby on Rails Community.

You are here: Browse Railsplugins Relation Browser

Relation Browser

Based on RelationBrowser written by Moritz Stefaner (http://der-mo.net) RelationBrowser is released under a Creative Commons license, please refer to the file rb_license.txt for details.

RelationBrowser is a Flash application that provides a visually appealing view of relationships between objects. This plugin makes it trivial to use RelationBrowser with your rails application.

Requirements

You need to have “acts_as_nested_set” declared in the models you want to use the plugin for. You’ll also want to have parent/child relationships setup to see anything useful! Alternatively you can implement your own system for creating a hierarchy, you just need to provide the following methods: full_set, children, direct_children

I also recommend the BetterNestedSet plugin which extends acts_as_nested_set with some further useful methods and optimizations: http://opensource.symetrie.com/trac/better_nested_set/

In the controllers you want to use this on, add the following: relation_browser :<model name>

Where :<model name> is optional and only needed if the model name doesn’t match the controller name or can’t be determined by the plugin.

Usage

You’ll be automatically provided 3 new methods for your controller:

relationships = the main browser root/<id> = the base relationships in XML that RelationBrowser can load children/<id> = XML output for specific object relationships

Example: http://localhost:3000/things/relationships/1 http://localhost:3000/things/root/1 <- http: starting xml output point tree /><- xml of output thing children>bq. NOTE: This description has been extracted from the Plugin README and so the formatting may need updating to make browser friendly

Users


See all details


Membership

+ Join this railsplugin

Record Maintainer

'None'