Forum: Ruby on Rails Help with routing error.

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
John N. Alegre (Guest)
on 2006-03-02 16:05
(Received via mailing list)
Ok .. if you are sensitive ... stop reading.

I am totally new to setting up CGI.  I am getting a routing error.
Would someone be kind enough to help me?  Please?

Here is my form ...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitiona...

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
  <meta http-equiv="content-type" content="text/html;charset=utf-8" />
  <meta name="generator" content="Adobe GoLive" />
  <title>Form | Contact A</title>
</head>

<body bgcolor="#ffffff">

  <form action="cgi-bin/parse.rb" method="post" #I have tried get
enctype="application/x-www-form-urlencoded"> #I have tried text/plain

<table width="455" border="0" cellspacing="0" cellpadding="5">				<tr
height="33">
<from stuff deleted>

I put this in the public folder of a rails WEBrick app.

Here is my Ruby CGI ...

###################################################
#!/opt/local/bin/ruby -w

text = "dog"
print "Content-type: text/html\r\n\r\n"
print "<HTML><BODY>"
print "<B><I>Hello</I>, #{ text} !</B>"
print "</BODY></HTML>"
##################################################
I put this in cgi-bin directory in the same dir as the forms.html
file.  Permissions on the Ruby script where set to 775.  My intention
is not to handle any input from the forms.html file but just to get
back a simple ""Hello dog" after the submit.

here is what i get when i run WEBrick and hit the Submit button ...

Routing Error

Recognition failed for "cgi-bin/parse.rb"

Can anyone help me.   I am not sure if this is a problem with my code,
WEBrick of the form.

Thanks and don't be shy .. i have a thick skin.

john
John N. Alegre (Guest)
on 2006-03-02 22:02
(Received via mailing list)
Anybody ... please ...
Ben Munat (Guest)
on 2006-03-03 07:47
(Received via mailing list)
Um, all this stuff has nothing to do with Ruby on Rails really.

If I understand correctly you're trying to submit a http post to a Ruby
CGI script. But,
that's not how rails works, or at least I haven't seen or read about
anyone doing that.
Are you just trying to test CGI? But even if that's the intent, I don't
think what you're
doing is even close to how rails uses CGI.

Maybe say what it is you're trying to accomplish and we can try to help.

b
This topic is locked and can not be replied to.