Getting user input from user on a webpage?

Discussion in 'Ruby' started by Adam Lee, Jun 10, 2009.

  1. Adam Lee

    Adam Lee Guest

    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-forum.com/.
    Adam Lee, Jun 10, 2009
    #1
    1. Advertising

  2. 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-forum.com/.
    Mike Stephens, Jun 10, 2009
    #2
    1. Advertising

  3. Adam Lee

    Adam Lee Guest

    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-forum.com/.
    Adam Lee, Jun 10, 2009
    #3
  4. 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-forum.com/.
    Mike Stephens, Jun 10, 2009
    #4
  5. Adam Lee

    Adam Lee Guest

    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-forum.com/.
    Adam Lee, Jun 10, 2009
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    419
  2. Replies:
    3
    Views:
    389
  3. Paul
    Replies:
    14
    Views:
    842
    Alexey Smirnov
    Jun 19, 2008
  4. sifar
    Replies:
    5
    Views:
    415
  5. soren625
    Replies:
    2
    Views:
    371
    soren625
    Dec 12, 2006
Loading...

Share This Page