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:
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:
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!
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"
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).
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.
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).