[Nitro] [oree.ch] Patchset #1

zimba.tm zimba.tm at gmail.com
Wed Feb 8 15:53:07 EST 2006

Hello devs,

I have put some changes in my own nitro repo at http://oree.ch/nitro. Here are 
the changes :

* part/admin : sorting of managed classes and system configuration

Self explanatory I think.

* scaffolding and part/admin support managed classes in modules

Scaffolding had some problems with classes that are in modules. Now you can 
scaffold eg. Video::Stream without problem.

TODO : there is still a problem if you have a root Video for example. Because 
then video/stream looks for streams that are in Video relation and not the 
Video::Stream class. (look in the spark admin, WikiPage::Revision has a 
problem because WikiPage is also there)

FIXME : some links are in the form of wiki_page__revisions instead of 

* Implemented a new Control system : Form Control moved in Nitro::Form, added 
a Controls transformer, Nitro::Action is a generic action

= Make your own controls :

class MyControl < Nitro::Control
  def template
    %~<input type="text" name="@name" value="@value.to_s" />~

= In your template :

<MyControl name="w00t" value="@test" />

the value is evaled in the controller, so you can import your own values

= Build dynamic controls :

class Test
  def to_s

Nitro::DynamicControl.map[Test] = MyControl

= In your action

@test = Test.new

= In your template

<Control name="hello" value="@test" />

= Gives

<input type="text" name="hello" value="heyhey" />


inputs are welcom :)


weblog : http://zimba.oree.ch

More information about the Nitro-general mailing list