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.
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.
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!!
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.
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.