Something like PHP imports or ASP WUC

i am used to work with php, and mostly i create an menu on one page and the
content on another page (2 template and i load the one in the other), so i
dont have to put the menu on every page, when i want to update something
from the menu then i dont need to change it ex 20 times, like a Web user
control in asp

is there something like this in ruby

Nick wrote:

i am used to work with php, and mostly i create an menu on one page and the
content on another page (2 template and i load the one in the other), so i
dont have to put the menu on every page, when i want to update something
from the menu then i dont need to change it ex 20 times, like a Web user
control in asp

is there something like this in ruby

Well, there are numerous templating libraries written in Ruby, each with some form of external file inclusion.

For example, in Nitro, one can do

<body>
    <render href="header" />

    ....

where "header" refers to an external common file.

http://rubyforge.org/projects/nitro

James

···

--

http://www.ruby-doc.org - The Ruby Documentation Site
http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML
http://www.rubystuff.com - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com - Playing with Better Toys

Something along the lines of eRuby or erb would probably feel the most familiar, coming from PHP:

http://www.modruby.net/en/index.rbx/eruby/

http://www.ruby-doc.org/stdlib/libdoc/erb/rdoc/

Also, the built-in CGI class could do the same.

-Justin

···

-----Original Message-----
From: Nick [mailto:glenn.brutyn@telenet.be]
Sent: Sun 9/25/2005 6:11 AM
To: ruby-talk ML
Subject: something like PHP imports or ASP WUC

i am used to work with php, and mostly i create an menu on one page and the
content on another page (2 template and i load the one in the other), so i
dont have to put the menu on every page, when i want to update something
from the menu then i dont need to change it ex 20 times, like a Web user
control in asp

is there something like this in ruby

Try Rails, too.

http://www.rubyonrails.com/
1. See the webpage for details on the mailing list.
2. Rails Layouts do exactly what you'd like. Running script/generate scaffolding foo will show you an example of a layout (under app/views/layouts).

Devin

···

-----Original Message-----
From: Nick [mailto:glenn.brutyn@telenet.be]
Sent: Sun 9/25/2005 6:11 AM
To: ruby-talk ML
Subject: something like PHP imports or ASP WUC

i am used to work with php, and mostly i create an menu on one page and the
content on another page (2 template and i load the one in the other), so i
dont have to put the menu on every page, when i want to update something
from the menu then i dont need to change it ex 20 times, like a Web user
control in asp

is there something like this in ruby