(noob) Help with variables

I’m trying to make what amounts to a cloud files manager using the ruby
API. In the end I want login via MySQL and all that fun stuff, but for
now I want it to just -work-. I’m using eruby loaded via CGI on apache.

So I was able to list the containers on my account:

<% require ‘rubygems’
require ‘cloudfiles’
cf = CloudFiles::Connection::new(‘ryuujinx’,‘APIKEYREMOVED’) %>

Cloud Files Manager

List of Containers:

<% cf::list_containers::each do |listcont| puts listcont + "
" end %>

I could make it do it in a select menu with a form, etc, but my problem
is even if I do post it to a new page, I have no idea how to grab the
variables or anything.

The next step I would want to do is container =
cf::container(‘SELECTEDCONTAINER’) for further manipulation such as the
ability to manage objects inside the container, but I’m kind of lost.

2010/3/11 James D. [email protected]:

cf::list_containers::each do |listcont|
puts listcont + “

end
%>

I believe you rather want

<% cf::list_containers::each do |listcont| %>
<%= listcont %>

<% end %>

I could make it do it in a select menu with a form, etc, but my problem
is even if I do post it to a new page, I have no idea how to grab the
variables or anything.

Not sure what you mean by “grab variables”. If you need to evaluate
HTML form variables you can use
http://www.ruby-doc.org/core/classes/CGI.html

The next step I would want to do is container =
cf::container(‘SELECTEDCONTAINER’) for further manipulation such as the
ability to manage objects inside the container, but I’m kind of lost.

Kind regards

robert

Robert K. wrote:

Not sure what you mean by “grab variables”. If you need to evaluate
HTML form variables you can use
http://www.ruby-doc.org/core/classes/CGI.html

Kind regards

robert

Basically I want to be able to get variables from posting forms.

In PHP I would want to do something along the lines of

then on somepage.php use

The var on the last page was<?php echo $_POST["somevar"]; ?>

Only using ruby; in the article you linked I see CGI::Query that could
probably work if I use the GET method for the form instead of the POST
method; is there a way to use POST like shown with the php example?

2010/3/11 James D. [email protected]:

Basically I want to be able to get variables from posting forms.
The var on the last page was<?php echo $_POST["somevar"]; ?>

Only using ruby; in the article you linked I see CGI::Query that could
probably work if I use the GET method for the form instead of the POST
method; is there a way to use POST like shown with the php example?

Google for “ruby cgi post” reveals this as first hit:

Note: Ruby will take care of GET and POST methods
automatically. There is no separate treament for these two different
methods.

Cheers

robert