From: Bill Kelly Date: 2008-03-25T07:39:20+09:00 Subject: Re: Ruby? From: "Gib Let" > > But what type of things would you use Ruby for within a website? And > would you use HTML for example, to create the structure, or is it all > done in Ruby? To develop a project of any significant size, you'll probably want to look into one of the many available ruby web frameworks, as others have mentioned. However it is also possible to start very simply. Here is a "hello world" web program in ruby, using the built-in CGI module: http://billk.tastyspleen.net/cgi-bin/hello-world.cgi As can be seen from the source code shown on the page, the HTML is generated dynamically using cgi methods. Here's a more real world example of using the CGI module. This is a program that queries a bunch of online game servers and displays info about which players are currently connected to which servers: http://tastyspleen.net/quake/servers/list.cgi The source code for that program is here: http://tastyspleen.net/quake/servers/list.rb Again, we see all the HTML is dynamically generated within the program itself. This inline approach is often OK for small programs like this, but if one were writing larger web programs, it's preferable to separate the HTML from the code. This is usually accomplished with a templating system, which you'll be introduced to when you begin exploring the various ruby web frameworks available. Hope this helps, Bill