well, I've finally solved the thing
I tried in the controller the following
class Session
def sayHello
"hello"
end
end
and then, I saw the error saying something about
CGI::Session
In the C:\ruby\lib\ruby\1.8\cgi\session.rb file, the Session declaration
wa inside the CGI class, so I had to
class CGI::Session
def sayHello
"hello"
end
end
and it just worked
so I went on and defined
class CGI::Session
def data
unless @data
@data = @dbman.restore
end
@data
end
def each(&block)
data.each &block
end
def each_pair(&block)
data.each_pair &block
end
end
BTW, is there some way to redirect a bunch of methods (each, each_key,
each_pair, each_value, empty?, to_a, etc... I guess you know what I
mean) from self to self.data?
and then, to give it a try, in a view I added the following
<table border="1">
<tr><th colspan="2">params</th></tr>
<tr><th>key</th><th>value</th></tr>
<% session.each_pair { |key, value| %>
<tr><th><%= h key %></th><th><%= h value %></th></tr>
<% } %>
</table>
Well, that's all
Saludos
Sas
PS: I'm pretty impressed with how easy is to extend ruby. Just imagine
doing such a thing in asp...
--
Posted via http://www.ruby-forum.com/.