From: brabuhr@... Date: 2008-03-25T07:05:58+09:00 Subject: Re: Ruby? On Mon, Mar 24, 2008 at 5:27 PM, Gib Let wrote: > 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? Well, it really depends on what your website is intended to do and what Ruby technology/framework you choose. For example, in something like Rails the site structure emerges from the Ruby (controller) classes and the content of the pages would be built from HTML with embedded Ruby expressions. (Of course, I have glossed over a lot with this simplistic description.) So, for the sake of argument, say your website tracks cars and their drivers and you are using something Rails-like. You could create the following Ruby controller classes: CarsController and DriversController In CarsController, define methods like new and list Then you could have URLs like /cars/list /cars/new Each method could have a corresponding HTML snippet (new.rhtml and list.rhtml) list.rhtml may look like: <% cars.each do |car| %>
  • <%= car.vin %>
  • <% end %> http://www.rubyonrails.org/screencasts