From: Rick DeNatale Date: 2007-03-22T03:23:03+09:00 Subject: Re: Nees Rhtml Book On 3/20/07, John Joyce wrote: > You could use eRuby with any .extension > In fact you could serve web pages with any or no dot extension. > The key is that the server knows what to do with it. > An example is Apache. You tell Apache what to do with files of > various extensions. You could tell it to parse all .html files with > Ruby, or all .php files with Perl. > Thus, many rails pages show URL/URI with no dot extension at all in > the web browser. It is important only if you use multiple language > interpreters or your web application framework requires it. Right, and in fact, rails URL/URIs typically don't have a dot extension. It's action pack which is looking at the files not Apache. The extension comes into play when the controller renders a view. Then Rails looks for a template file to render using conventions. E.g. if the FooController#display action renders, say, it's default view, the template will be looked for in app/views and if display.rhtml is found it will get processed by eRuby to produce the body of the HTTP response, or if display.rxml is found it will be processed by Builder. You can register template processors to handle other kinds of template files. And Rails uses eRuby for other things, for example it runs config/database.yml through eRuby which lets you do a certain amount of dynamic configuration. -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/