[Nitro] Generating scaffolding / stub codes?

Bryan Soto bryan.a.soto at gmail.com
Wed Feb 22 16:15:30 EST 2006

On 2/22/06, S P Arif Sahari Wibowo <arifsaha at yahoo.com> wrote:
> On Tue, 21 Feb 2006, Bryan Soto wrote:
> > Sadly, that's not exactly true. It also in theory understands
> > gen form. Unfortunately, it appears to have shipped broken in
> > 0.28.0. And doesn't appear to be documented in the usage
> > either.
> >
> > If you are interested in using it, it's a simple fix. From the
> > ruby installation directory,
> Hey, that sounds good! I'll take a look.
> > It's outputs the xhtml form that would represent the object
> > and can probably be called via render in your pages. It
> > doesn't generate whole pages for you.
> So it need a little more work. :-) A form should be both view
> and controller, right?

What doesn't need a little more work? ;)

I believe after George (head Nitro/Og developer) wrote that, he started
concentrating more on scaffolding. If you'd like to see some of what he did,
try requiring 'part/admin' in your run.rb file and then go to
localhost:9999/admin assuming you're running via webrick. The scaffolding in
Nitro basically does incorporate both the controller and view. Perhaps
that's what you're looking for? In your controller class, add a "scaffold
MODEL_NAME_HERE". Assuming you scaffold Comment, you should be able to
browse to /comments/list, /comments/view, etc. The scaffolding framework
generates both the appropriate HTML and Ruby code for the controller.

As a note, the scaffolding currently has a dependency on 'part/admin' which
it probably shouldn't. So be sure to keep the require 'part/admin' in your
run.rb file for now. I'll add that to the bug tracker. 'part/admin' performs
scaffolding on all Og managed classes, but does other dangerous things so be
wary. It really is only for administrators.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/nitro-general/attachments/20060222/7ef06f9b/attachment.html 

More information about the Nitro-general mailing list