From: Pit Capitain Date: 2003-08-21T17:19:08+09:00 Subject: Re: How do I handle an HTML form from ruby? On 21 Aug 2003 at 11:52, Ludwigi Beethoven wrote: > No, I don't have an HTTP server running. I guess I > could install apache, but I thought that it was much > simpler. > All the examples make it look simple. Oh well! Ludwigi, I'm not sure what you want exactly. > > >I am trying to learn how to manipulate HTML files > > with > > >ruby at the same time that I learn HTML. I created > > a > > >simple html file that contains among other things, > > >input text fields and some buttons. What do you mean by "manipulate"? Do you want to treat an HTML file as text and do some processing on it, for example extracting the URL of an image, or do you want to build a web application that processes the user input in some way? > > >The problem now is: > > > > > >How do I tell ruby to run the html file? What do you mean by "run" the file? If you only want to look at it, then you just ... > > >Do I need to passit to a browser and if so, how? ... open the file in your browser (usually via the File/Open menu). > > >How do I capture user's input? This is where you start building a web application. If you press the submit button in the browser, the browser sends the user's input via the HTTP protocol somewhere (the target being mentioned in the
tag). So you need a program that is able to process the data. I suppose you want to use a Ruby program for that. If so, then you have several choices, for example Webrick (look in the RAA). HTH Regards, Pit