From: Ezra Zygmuntowicz Date: 2006-09-21T12:37:59+09:00 Subject: Re: super simple serving of ruby pages On Sep 20, 2006, at 8:05 PM, James Britt wrote: > zerohalo wrote: >> Hi. I apologize in advance if this is a dumb question, but though >> I've >> searched online I haven't found an answer. >> I'm starting to teach my 8yr daughter Ruby. We've covered HTML and >> CSS >> already and she handcoded her own static website. I'd like to >> incorporate her Ruby learning experience into her website, which is >> much more interesting for her than using Ruby to write scripts or >> desktop apps. She's just starting out, so Rails is much too >> complicated >> for her. She's not ready for the whole MVC concept yet. What I'd like >> to do is to run very simple Ruby scripts from the site and >> incorporate >> Ruby code into rhtml files, but without Rails. I don't really want a >> "framework", just the ability to run a ruby file that will serve >> up an >> rhtml file. In other words, something very simple like PHP (I don't >> want to teach her PHP). [I'll get into Rails later once she's more >> advanced.] >> ERb looks like the ticket, but there's a missing link (for me). I can >> write a ruby script that generates an rhtml file, but then how do I >> serve that rhtml file without a framework like >> Rails/Nitro/Camping/etc.? Probably the answer is with Webrick >> somehow, >> but I'm missing the connection. I can't find a simple tutorial >> anywhere >> online, and I'm no expert on web applications. > > I've an example of this that's ~100 lines of code, if you're > interested. > > Maps URLs to classes and templates and renders them, using erb and > Webrick. > > > > -- > James Britt I'd be interested in seeing that James. Thanks -Ezra