Receivein a Post Attribute

Hi!

This should be quite easy but I can't for the life of me find a
solution.

I have the following form:

<form name="input" action="Main.rb" method="post">
    Url to examine: <input type="text" name="url"/>
    <input type="submit" value="analyzeUrl" />
</form>

As you see the action taken when the button is pressed involves a ruby
file "Main.rb".

The Apache-server has no problem interpreting the file. The problem is
how do I pass along the text written in the textfield.

I'm guessing I need to retrieve the text in Main.rb I've failed
miserably at that.

Main.rb contains only:

ARGV.each do|a|
  puts "#{a}";
end

But the only time it writes out anything is when I manually send
Main.rb?some_parameter. Then the printout will be "some_parameter".

Summary:
How do I retrieve the text from the text field in Ruby?

Thanks in advance
...And sorry if this already has been answered. I did searched.

···

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

This is the Ruby mailing list, not the Rails one. Rails may be written
in Ruby, but they have their own forum:

You're likely to get more answers there.

Vale,
Marvin

···

Am 16.02.2011 16:41, schrieb Ivan Rodriguez:

Hi!

This should be quite easy but I can't for the life of me find a
solution.

I have the following form:

<form name="input" action="Main.rb" method="post">
    Url to examine: <input type="text" name="url"/>
    <input type="submit" value="analyzeUrl" />
</form>

As you see the action taken when the button is pressed involves a ruby
file "Main.rb".

The Apache-server has no problem interpreting the file. The problem is
how do I pass along the text written in the textfield.

I'm guessing I need to retrieve the text in Main.rb I've failed
miserably at that.

Main.rb contains only:

ARGV.each do|a|
  puts "#{a}";
end

But the only time it writes out anything is when I manually send
Main.rb?some_parameter. Then the printout will be "some_parameter".

Summary:
How do I retrieve the text from the text field in Ruby?

Thanks in advance
...And sorry if this already has been answered. I did searched.

Hi!

This should be quite easy but I can't for the life of me find a
solution.

I have the following form:

<form name="input" action="Main.rb" method="post">
   Url to examine: <input type="text" name="url"/>
   <input type="submit" value="analyzeUrl" />
</form>

As you see the action taken when the button is pressed involves a ruby
file "Main.rb".

The Apache-server has no problem interpreting the file. The problem is
how do I pass along the text written in the textfield.

I'm guessing I need to retrieve the text in Main.rb I've failed
miserably at that.

Main.rb contains only:

ARGV.each do|a|
puts "#{a}";
end

But the only time it writes out anything is when I manually send
Main.rb?some_parameter. Then the printout will be "some_parameter".

Summary:
How do I retrieve the text from the text field in Ruby?

Thanks in advance
...And sorry if this already has been answered. I did searched.

This is the Ruby mailing list, not the Rails one. Rails may be written
in Ruby, but they have their own forum:
Rails - Ruby-Forum

You're likely to get more answers there.

Except this isn't a rails question at all.

Ivan: you may want to look into the CGI module, which should abstract most of this stuff away and make it easier to do what you're trying to do.

Ben

···

On Feb 16, 2011, at 8:56 AM, Quintus <sutniuq@gmx.net> wrote:

Am 16.02.2011 16:41, schrieb Ivan Rodriguez: