branch14.org

README

      Moritz Plugin
      =============
      
      Moritz is a Plugin for Ruby On Rails that helps bringing Moritz
      Stefaner's Relation Browser easily to any Rails App.
      
      Install it like this
      
        $ script/plugin install git://github.com/branch14/moritz.git
      
      Please find Moritz's work here:
      
        http://moritz.stefaner.eu/projects/relation-browser/
      
      
      Example
      =======
      
      Automatic Install
      -----------------
      
         $ rake moritz:install model=mproxy controller=moritz
      
      
      Manual Install
      --------------
      
      1. Generate a proxy model, e.g.
      
         $ script/generate moritz mproxy
      
         Rename the generated model
      
         $ mv app/models/mproxy.rb_ app/models/mproxy.rb
      
      2. Generate a proxy controller, e.g.
         (just in case you don't want to use an existing controller)
      
         $ CONTROLLER=moritz
         $ script/generate controller $CONTROLLER
      
      3. Add relation brwoser functionality to the controller, e.g.
      
         relation_browser :mproxy
      
      4. Copy the views
      
         $ cp vendor/plugins/moritz/resources/views/*.rxml app/views/$CONTROLLER
      
      5. Copy the RelationsBrowser of your choice, e.g.
      
         $ cp vendor/plugins/moritz/resources//RelationBrowser_v1.2/generic/RelationBrowser.swf public
      
      6. Browse to ...
      
         /RelationBrowser.swf?dataSource=//root/_
      
      
      Customizations
      --------------
      
      1. data gathering and proxy magic is happening in the generated model, e.g.
      
         app/models/mproxy.rb
      
         The last method defined in the model is 'association_method'. This
         method is generated base on the information available at time of
         installation of the plugin. If you don't want to dispay for example
         join models of has_many :through association, this is the place to
         do some editing.
      
         It's planed to replace this customization method by an entirly
         generic method while putting the configuration into a bloc that is
         passed in the controller.
      
      2. XML is rendered here
      
         app/views/$CONTROLLER/root.rxml
         app/views/$CONTROLLER/children.rxml
      
      
      Have fun!
      
      --
      Copyright (c) 2008,2009 Ed Allen & Phil Hofmann, released under the MIT license
      

Browse Code

See it in action