[Nitro] Problem with Nitro In Flames tutorial

Michael Fellinger m.fellinger at gmail.com
Mon Dec 26 02:19:48 EST 2005


To tell you a bit about how i myself learned nitro/og.
It was no straight way - for example i only used my PHP-style of doing things 
in Nitro first, without giving a crap about models/controllers, since nobody 
gave me a good example how they work and why i would want to use them.
I had some experience in doing Web-stuff, the little examples gave me a 
glimpse of the features Nitro might provide me with, but with no actual idea 
how i utilize it there was no chance to do anything really productive with 
Eventually George released Spark/Flare - wich was a great breakthrough for me 
(and us all). I just took Spark and started modifying it (that is how rdog 
was integrated in Spark). The main-point is that there were lots of patient 
people who helped me along and provided me with new goals.
The only way you can learn Nitro/Og at the moment is step-by-step. I don't 
think you can just set out and create what you want, you have to explore 
everything, find a way Nitro/Og integrates into your workflow and partially 
using more and more features it provides.
For example i know that #{} #|| #() work together with different kinds of 
transformers, but don't ask me what they exactly are - i only use #{} and it 
works fine for me.
Learning Nitro is a tendious work, you first code something wich is not DRY at 
all and doesn't use much dynamic code. I think Ysabel once said that Nitro is 
perfect for refactoring static pages. I have to agree on that.

Nitro is all about refactoring!
Nitro is all about choice!

You may have heard these sentences before, in various kinds, however, that is 
what Nitro is all about - and Og helps the concept... letting you work as 
flexible as you probably ever will be working with a Database (we're not 
programming in 3d-models yet... :() - simply by treating them like every 
other Object in Ruby.
You are probably going the best way when you first make a normal static page 
and slowly walk into more dynamic generation.
For example a menu:
First doing it static:
<div class="menu"><a href="foo">Foo</a> | <a href="bar">Bar</a> | <a 

next step would be to copy&paste it to every page - but when you're taking a 
closer look at how Flare works, you see a lot of little <render href="menu"/> 
like tags in there, and guess what? They are helping you! :)
So you outsource the menu into a seperate menu.xhtml and replace the real menu 
with the render-tag. Now, that saves us a lot of rewriting-work... right?
But we could refactor the menu with some ruby...
<?r menu = ["foo", "bar", "foobar"] ?>
<div class="menu">
<?r for point in menu do ?>
<a href="#{point}">#{point}</a>
<?r end ?>

This might look a bit overkill at first, but imagine you want to add a 
target="_blank" to every menu-item... it will save you some work ;) and all 
it required was a little bit knowledge of Ruby and some digging in Code.
Of course, since you might have seen the nitro-videos you may know about the 
Skin (Nitro::Element) and how to use it, wich makes even the <render/> tag 
redunant... but this is only a little example to show how i got into Nitro 
and wants so give you some confidence that nobody in here had an easy time 
doing/learning it all - in the end you are rewarded.

Also, i want to encourage everyone who has questions about Nitro/Og to join us 
in the IRC-channel (irc.freenode.net #nitro) and asking these questions.
People helped me to learn Nitro/Og, and for learning and digging the Framework 
for weeks i was rewarded by this wonderful community and a new Job :)
In turn I want to help people, and the fastest way to do that in the IRC...

However, thanks to all the guys/gals that helped me so far and special thanks 
to George/TRANS/Emmanuoil :)

BTW, RDOG is making real progress, we've got the rdoc2og-generator ready!
So i hope in the next few days we can present you with a real database-driven 
page for the documentation.
thanks to the efforts of Vagabond!


Am Montag, 26. Dezember 2005 00:37 schrieb Alexandre Gravem:
> On 12/25/05, itsme213 <itsme213 at hotmail.com> wrote:
> > > (Having actual working examples would be Really Nice. As it stands, the
> > > threshold for learning to write Ruby web apps seems to be much lower
> >
> > with
> >
> > > Rails than Nitro. That's sad since Nitro appears to be technically
> > > superior.
> > > At this rate of progress I may have no other option than to get the
> >
> > Rails
> >
> > > book...)
> >
> > As I have done too. I'd rather use Nitro but it's so much harder getting
> > started in its current form ... hope that changes in time.
> I will join the "Bad docs are getting people away from Nitro" choir! I
> agree with everything that was said. I am trying hard to set up some
> learning projects using Nitro but it's too hard without good documentation.
> In my actual level there is little I can do for help!!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/nitro-general/attachments/20051226/a31e2c79/attachment.bin 

More information about the Nitro-general mailing list