From: sas sas Date: 2006-04-07T13:11:51+09:00 Subject: Re: accessing session with session.each 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 <% session.each_pair { |key, value| %> <% } %>
params
keyvalue
<%= h key %><%= h value %>
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/.