Forum: Ruby form handling using ruby

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Mark (Guest)
on 2007-06-14 07:12

I'm a newbie to ruby and web programming. I created a very simple html
form and set the action to "action=actionhandler.rb", after following an
example from a book. But when I click submit, instead of running
actionhandler.rb, my browser shows the source code of actionhandler.rb.
I'm running these things on Apache webserver. So where am I going wrong
? Do I need any additional plugins ? Any help would be greatly

My actionhandler.rb file looks as follows:


require 'cgi'
cgi =

puts cgi['name']
puts cgi['reason']


f.puts cgi['name']
f.puts cgi['reason']


John J. (Guest)
on 2007-06-14 17:56
(Received via mailing list)
On Jun 13, 2007, at 10:12 PM, Mark wrote:

> ? Do I need any additional plugins ? Any help would be greatly
> puts cgi['reason']
> --
> Posted via
Hey Mark,
Any time you do this, you need to set the permissions on the file, so
that it is executable.
But the symptom you are having is more often caused by the fact that
Apache doesn't know what to do with a file of the extension .rb  now.
You need to make sure it has mod_ruby or something.
In your web directory you should have a .htaccess file in which you
can write some Apache directives.
Google some of these and check the FAQ/support on your web server.
This topic is locked and can not be replied to.