[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Getting user input from user on a webpage?

Adam Lee

6/10/2009 1:35:00 AM

Hello, I was wondering if there is a way for a ruby script to get a user
input when it's running on a webserver. I need a basic function like
where there user can click on a button on a website which will invoke a
method.
--
Posted via http://www.ruby-....

4 Answers

Mike Stephens

6/10/2009 1:00:00 PM

0

When you saying "it's running a web server", what caused it to run?
Normally you'd expect a user message (eg HTTP GET from a web page) to
trigger the script. The web server would run the script using the HTTP
variables.

--
Posted via http://www.ruby-....

Adam Lee

6/10/2009 1:02:00 PM

0

Mike Stephens wrote:
> When you saying "it's running a web server", what caused it to run?
> Normally you'd expect a user message (eg HTTP GET from a web page) to
> trigger the script. The web server would run the script using the HTTP
> variables.

Hm can you briefly show me an example how I can pass a variable to a
script using HTTP GET? I think I'm almost there with your tip!!
--
Posted via http://www.ruby-....

Mike Stephens

6/10/2009 2:37:00 PM

0

How you pick up what the user has typed in the web page will depend on
the server you are running. For example in the Ruby CGI class you can
ask for individual fields or access them all with CGI#params. Have a
look at the Pickaxe book which I think is now bundled with the Ruby
download.

--
Posted via http://www.ruby-....

Adam Lee

6/10/2009 2:42:00 PM

0

Never realized the Pickaxe book is available for free. Although there is
a new version, I think the fundamentals are the same. Thanks for the
pointer :)

Mike Stephens wrote:
> How you pick up what the user has typed in the web page will depend on
> the server you are running. For example in the Ruby CGI class you can
> ask for individual fields or access them all with CGI#params. Have a
> look at the Pickaxe book which I think is now bundled with the Ruby
> download.

--
Posted via http://www.ruby-....