[Nitro] Nitro templating question

Jonas Pfenniger zimba.tm at gmail.com
Mon Jan 9 12:18:58 EST 2006

George Moschovitis wrote:

>>What I've found in skin.rb is a bunch of disconnected HTML embedded as
>>raw strings in Ruby code.  For anything but the most trivial page layout
>>that is a nightmare to design and maintain.
>I think rails layout system is only usefull for small, silly
>applications. Like many original rails features this seems tailored to
>37signals simplistic applications, this is not a general solution. I
>find Nitro's elements or xslt compilers to be much more intuitive,
>elegant and powerful. I mean:
>  ..
>class Nitro::Element
>  class Page
>     def render
>        %~
>   <head>
>   </head>
>   <body>
>    ...
>    ...
>    #{content}
>    ...
>    #{content :sidebar} <!-- renders content from sidebar -->
>   ...
>        ~
>     end
>is quite easy to do. I can easily add external template file support
>for elements to make this better for you (ie keep th render xhtml in a
>separate .xhtml file). Any other ideas?
>Nitro-general mailing list
>Nitro-general at rubyforge.org

I have some questions regarding the Elements.

I understand #{content :sidebar} use a child element, but I don't know
where to set it up. Is there an accessor in the controller for it ?

What is the difference between a Control and an Element ?

How do you change the template surrounding a page without changin the
enclosing tag ? eg. I use <Page> around my content, but sometimes I want
a different html template. It there a mechanism for this ?


More information about the Nitro-general mailing list