From: "Daniel P. Zepeda" Date: 2002-02-23T10:16:41+09:00 Subject: Re: eRuby and erb Personally, I don't see the advantage of using the embedding techniques. Forget for the moment that it is bad coding practice to mix your logic with the design, I've done quite well using something like this: http://www.rubycookbook.org/showrecipe.rb?sessionID=S4zJv47J6c1f3jaL&recipeID=137 It has been awhile since I wrote that. Since then I've found it easier to set up all the forms and other interactive content into variables that you then place on the page using CSS. That is, I tuck most of the heavy processing away in an object that interfaces with the content (database, whatever), then use the ASP-ish page to create the object which takes care of the session data, the database connectivity, etc, use that object by calling its methods, which return html in a string variable, which you use to place the HTML on the page using CSS to position and control the look. This way, you have the separation of logic and interface: you get very short, ASP-ish pages where you can manipulate the placement of the content that was generated by the processing object, which can be changed, say from using one database to another, without disturbing the presentation pages. No fooling with erb or eruby *plus* you get the power of the CGI object to aid in handling cookies, sessio! ns etc. *and* finally, a more portable program, since you don't have to worry about if erb|eruby is installed, configured properly, etc. I find this simple, flexible approach superior to the embedding techniques, which IMHO are just carrying over bad programming practices from Microsoft, whom probably stole the idea from someone else anyway. BTW, I also use this approach with Perl, and all the same comments apply. On Fri, 22 Feb 2002 07:41:56 +0900 m_seki@mva.biglobe.ne.jp wrote: > > Hi, > > > I would like to use either of eRuby or erb for my web design. > > What's the difference? > > Do you use both for the same program? > > Which one is better in which case? > > It is dependent on your application. > > > Please tell us your experience? > > > NaHi's post is detailed about eruby and erb. > > * http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/2734 -- Daniel P. Zepeda daniel@zepeda-zone.net