[Nitro] how to initialize @color and make it visible into the template?

Jimmy Jazz Jimmy.Jazz at gmx.net
Sun Jul 15 09:15:27 EDT 2007

Jonathan Buch a écrit :

> You do that by escaping.   "\#{@color}", this saves the string
> "#{@color}" back to the template, which then gets normally executed
> like you had written #{@color} in the template.
> I's just a matter of scope here.

Indeed, that's made it. I made a mistake as I took the example from
tc_element.rb and spark as such. It is without the backslash. I'm now
able to use the variable within a <?r ?> or a controller.

> Well, we aren't actually working on making Nitro elitist.  ;) 

I understand your point of view :)

Nitro offers many possibilities and does so much out of the sight of the
user, that is why i'm not always sure how to handle nitro. In my
opinion, the best documentation is the code itself. Also, the code is
quite technical and also difficult to understand (the number of modules
and files take a part of that difficulty) . I think it would be great to
just have a brief documentation that give us a view of nitro's internal,
like how the compilers, filters and dispatchers are working together and
why nitro is using annotations or settings for example.
George write a useful explanation how og works with nitro. Also he made
og so transparent that we could even not to know about it at all ;) The
same introduction about nitro would be great.

> that very few people are working on making it less elitist (meaning docs,
> tutorials, examples).
> This is a cycle, no people no docs, no docs no people.  Which also means,
> anybody can help break that cycle, simply by writing down your own
> experience, like a small tutorial on what you find important to know
> as a beginner.
I have followed nitro for a couple of month and i found it really
interesting to use. I'm sure George is on the right way to make nitro
popular and useful for geeks as well for noobs.
Also, the best gift you could give to a beginner, is perhaps a simple
model of a dynamic web site with just the minimum functionalities
(without javascript, ajax, etc) that nitro can give (and not what nitro
can hide ;). So he can understand how whole the thing interacts,
discover the power of nitro and share his experience with the community.
Contrary to spark or nitro blog, the model should just be composed of
"useful" and various bricks to illustrate nitro's functionalities. So
you won't need to write documentations up to date. The videos were a
good idea, but it is quite hard to follow. At any first difficulty, you
will lose the thread of the demonstration. Anyway, that is a good
promotion for nitro.

Before Nitro I was never interested in web development because i have
always found it too messy. As i discovered ruby my point of view has
radically changed. You are now able to build your own web pages in an
elegant and "easy" way. And that is what matters.

To write a tutorial you must know where to go and what is important to
know. I'm just illiterate in nitro "language" to do it now.
I hope i will soon be able to offer something useful and break the cycle
you described.

> The second is, fast development cycle means docs are out of date fast,
> so, few people to keep them up to date, which means bad docs, which also
> creates problems for beginners.  So, we need more stable people who
> constantly update docs.  Hard, very.
> I'm far beyond the beginner levels sadly and can't really forsee what
> beginners need, but at least I try to help.  :)
Anyway, you have done it really well. You take time to answer questions
even if like mine (sorry for that) they are not really relevant and

> Everything in Ruby or any other programming language is a matter
> of scope, try to think 'where does this variable appear, where
> am I now, can I access this variable from the current scope?'.
> If the variable can't be accessed from the current scope, there's
> two possibilities, bring the foreign scope to the current one,
> or bring the 'execution' of the variable to the foreign scope.
You have finally answered to your own interrogation about beginners: It
is a matter of scope and not only on the programming language level. One
question could be: How should a variable, an instance or a method be
accessed between the different files into a nitro application tree to
make a site dynamic with a MVC approach ?

Nitro gives us a lot of liberty and that is certainly what is the most
exciting but what actually makes it difficult to understand.It looks
certainly trivial to you because you are working with it and participate
in of its development, but not to us, beginners. It just like that: Do I
have the right information and how can I use it ? :).


            |\      _,,,---,,_
      ZZZzz /,`.-'`'    -.  ;-;;,_
           |,4-  ) )-,_. ,\ (  `'-'
          '---''(_/--'  `-'\_)

More information about the Nitro-general mailing list