How do I handle an HTML form from ruby?

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. The problem now
is:

How do I tell ruby to run the html file?

Do I need to passit to a browser and if so, how?

How do I capture user’s input?

I am including the html file, if anyone would like to
look at it.

Thank you

Phone and Address Book


Ruby

Telephone and Address Book First Name:
Last Name:
Address:

Testing

one two This is my title



newpage1.html (1.27 KB)

···

Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

Hello,

It is not easy as it seems…
First at all you should have an HTTP server running … do you have
one (apache.org) ?

regards.

Ludwigi Beethoven wrote:

···

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. The problem now
is:

How do I tell ruby to run the html file?

Do I need to passit to a browser and if so, how?

How do I capture user’s input?

I am including the html file, if anyone would like to
look at it.

Thank you

Phone and Address Book


Ruby

Telephone and Address Book First Name:
Last Name:
Address:

Testing

one two This is my title




Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com


Ruby

/Telephone and Address Book/

First Name:
Last Name:
Address:

Testing

This is my title

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!

Thank you

— “Bermejo, Rodrigo” rodrigo.bermejo@ps.ge.com
wrote:

···

Hello,

It is not easy as it seems…
First at all you should have an HTTP server running
… do you have
one (apache.org) ?

regards.

Ludwigi Beethoven wrote:

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. The problem now
is:

How do I tell ruby to run the html file?

Do I need to passit to a browser and if so, how?

How do I capture user’s input?

I am including the html file, if anyone would like
to
look at it.

Thank you

<META name="GENERATOR" content="IBM WebSphere </blockquote> <p>Homepage</p> <blockquote> <p>Builder V5.0.1 for Windows"></p> <TITLE>Phone and Address Book</TITLE> </HEAD> <BODY bgcolor="#ccffff" text="#ff0000"

link=“#cc6666

vlink=“#cc9999” alink=“#ffffff
background=“blue_p1b.gif”>


Ruby

Telephone and

Address

Book

First Name:
Last Name: <INPUT size="20" type="text"

name=“ln”>

Address:

Testing

one two This is my

title



Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site
design software
http://sitebuilder.yahoo.com


Ruby

/Telephone and Address Book/

First Name:
Last Name:
Address:

Testing

This is my title


Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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

···

On 21 Aug 2003 at 11:52, Ludwigi Beethoven wrote:

OK, first thank you for your help.
Now, let me make an attempt to explain what I want to
do.

On my quest to learn ruby, I wanted to design a simple
address book application. I wanted to be able to
display some kind of window/form with entry fields for
the mundane items that goes on a phone/address book.
First I thought about using a GUI interfact Tk/Fox.
Then I thought about using something simpler and more
“standard” to collect the data. So after reading about
ruby sopporting html forms and since the majority of
the systems out there use some kind of browser, I
thought that perhaps I could use html ruby support.
But it appears that although it is easy to design the
form, it is not that easy to display it.
I wanted to capture input data (phones, addresses,
etc.) and output the same type of data, after a
search.

Thank you

···

— Pit Capitain pit@capitain.de wrote:

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


Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com